Skip to content

Commit 44536f1

Browse files
committed
Prefer checking 'isEmpty' == false on collection (for performance reasons)
1 parent 8b7f8db commit 44536f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Services/PusherConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ import NWWebSocket
475475

476476
chan.auth = nil
477477

478-
while chan.unsentEvents.count > 0 {
478+
while !chan.unsentEvents.isEmpty {
479479
if let pusherEvent = chan.unsentEvents.popLast() {
480480
chan.trigger(eventName: pusherEvent.name, data: pusherEvent.data)
481481
}

0 commit comments

Comments
 (0)