Skip to content

Commit 251d781

Browse files
committed
Fixed Swift 5.6 support
1 parent d4d04af commit 251d781

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Sources/Socket/SocketManager.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ internal final class SocketManager {
3434
Task.detached(priority: Socket.configuration.monitorPriority) { [unowned self] in
3535
while await self.isMonitoring {
3636
do {
37-
let hasEvents = try await storage.update {
37+
let hasEvents = try await storage.update({ (state: inout ManagerState) -> Bool in
3838
// poll
39-
let hasEvents = try $0.poll()
39+
let hasEvents = try state.poll()
4040
// stop monitoring if no sockets
41-
if $0.pollDescriptors.isEmpty {
42-
$0.isMonitoring = false
41+
if state.pollDescriptors.isEmpty {
42+
state.isMonitoring = false
4343
}
4444
return hasEvents
45-
}
45+
})
4646
if hasEvents == false {
4747
try await Task.sleep(nanoseconds: Socket.configuration.monitorInterval)
4848
}

0 commit comments

Comments
 (0)