We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d966ea0 + d71e3aa commit 54ef859Copy full SHA for 54ef859
Sources/PostgresClientKit/ConnectionPool.swift
@@ -533,9 +533,14 @@ public class ConnectionPool {
533
private func earliestUnallocatedPooledConnection() -> PooledConnection? {
534
return pooledConnections.reduce(
535
nil,
536
- { $1.state == .unallocated &&
537
- $1.stateChanged < ($0?.stateChanged ?? Date.distantFuture) ?
538
- $1 : $0 })
+ {
+ if $1.state == .unallocated &&
+ $1.stateChanged < ($0?.stateChanged ?? Date.distantFuture) {
539
+ return $1
540
+ } else {
541
+ return $0
542
+ }
543
+ })
544
}
545
546
/// Caller responsible for threadsafety.
0 commit comments