diff --git a/Sources/PubNub/Subscription/SubscriptionSession.swift b/Sources/PubNub/Subscription/SubscriptionSession.swift index dba7d714..35b9fff0 100644 --- a/Sources/PubNub/Subscription/SubscriptionSession.swift +++ b/Sources/PubNub/Subscription/SubscriptionSession.swift @@ -125,7 +125,7 @@ class SubscriptionSession: EventEmitter, StatusEmitter { and: channelGroupSubscriptions, at: cursor?.timetoken ) - + let channelSubsToMerge = channelSubscriptions.reduce( into: [String: Subscription]() ) { accumulatedValue, subscription in @@ -133,7 +133,7 @@ class SubscriptionSession: EventEmitter, StatusEmitter { accumulatedValue[$0] = subscription } } - + let channelGroupSubsToMerge = channelGroupSubscriptions.reduce( into: [String: Subscription]() ) { accumulatedValue, subscription in @@ -141,12 +141,12 @@ class SubscriptionSession: EventEmitter, StatusEmitter { 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 } } } @@ -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)