Skip to content

Commit

Permalink
SwiftLint
Browse files Browse the repository at this point in the history
  • Loading branch information
jguz-pubnub committed Sep 12, 2024
1 parent 13fc78e commit be6abfc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/PubNub/Subscription/SubscriptionSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,28 @@ class SubscriptionSession: EventEmitter, StatusEmitter {
and: channelGroupSubscriptions,
at: cursor?.timetoken
)

let channelSubsToMerge = channelSubscriptions.reduce(
into: [String: Subscription]()
) { accumulatedValue, subscription in
subscription.subscriptionNames.forEach {
accumulatedValue[$0] = subscription
}
}

let channelGroupSubsToMerge = channelGroupSubscriptions.reduce(
into: [String: Subscription]()
) { accumulatedValue, subscription in
subscription.subscriptionNames.forEach {
accumulatedValue[$0] = subscription
}
}

globalChannelSubscriptions.lockedWrite {
$0.merge(channelSubsToMerge) { (_, new) in new }
$0.merge(channelSubsToMerge) { _, new in new }
}
globalGroupSubscriptions.lockedWrite {
$0.merge(channelGroupSubsToMerge) { (_, new) in new }
$0.merge(channelGroupSubsToMerge) { _, new in new }
}
}

Expand Down Expand Up @@ -180,13 +180,13 @@ class SubscriptionSession: EventEmitter, StatusEmitter {
and: globalGroupSubscriptions.lockedRead { $0 }.compactMap { groupNamesToUnsubscribe.contains($0.key) ? $0.value : nil },
presenceOnly: presenceOnly
)

globalChannelSubscriptions.lockedWrite { currentContainer in
channelNamesToUnsubscribe.forEach {
currentContainer.removeValue(forKey: $0)
}
}

globalGroupSubscriptions.lockedWrite { currentContainer in
groupNamesToUnsubscribe.forEach {
currentContainer.removeValue(forKey: $0)
Expand Down

0 comments on commit be6abfc

Please sign in to comment.