File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import PubNubChat
1313
1414class ChatAdapter {
1515 private static var associations : [ Association ] = [ ]
16- private static let queue = DispatchQueue ( label: " ChatAdapter.associations " , attributes : . concurrent )
16+ private static let queue = DispatchQueue ( label: " ChatAdapter.associations " )
1717 private init ( ) { }
1818
1919 static func map( chat: PubNubChat . Chat ) -> Association {
@@ -27,15 +27,13 @@ class ChatAdapter {
2727 }
2828
2929 static func associate( chat: ChatImpl , with kotlinChat: PubNubChat . ChatImpl ) {
30- queue. async ( flags: . barrier) {
31- if !associations. contains ( where: { !$0. isEmpty ( ) && $0. chat !== chat && $0. kotlinChat !== kotlinChat } ) {
32- associations. append ( . init( chat: chat, kotlinChat: kotlinChat) )
33- }
30+ queue. sync {
31+ associations. append ( . init( chat: chat, kotlinChat: kotlinChat) )
3432 }
3533 }
3634
3735 static func clean( ) {
38- queue. async ( flags : . barrier ) {
36+ queue. sync {
3937 associations. removeAll {
4038 $0. isEmpty ( )
4139 }
You can’t perform that action at this time.
0 commit comments