Skip to content

Commit 54ef859

Browse files
committed
Merge branch 'develop' for v0.3.1
2 parents d966ea0 + d71e3aa commit 54ef859

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Sources/PostgresClientKit/ConnectionPool.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,14 @@ public class ConnectionPool {
533533
private func earliestUnallocatedPooledConnection() -> PooledConnection? {
534534
return pooledConnections.reduce(
535535
nil,
536-
{ $1.state == .unallocated &&
537-
$1.stateChanged < ($0?.stateChanged ?? Date.distantFuture) ?
538-
$1 : $0 })
536+
{
537+
if $1.state == .unallocated &&
538+
$1.stateChanged < ($0?.stateChanged ?? Date.distantFuture) {
539+
return $1
540+
} else {
541+
return $0
542+
}
543+
})
539544
}
540545

541546
/// Caller responsible for threadsafety.

0 commit comments

Comments
 (0)