Skip to content

Commit a573e0e

Browse files
remove unnecssary check in checkIn
1 parent 4d789cd commit a573e0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cmap/connection_pool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,10 +399,10 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
399399
this[kConnections].unshift(connection);
400400
}
401401

402-
const wasConnectionDeleted = this[kCheckedOut].delete(connection);
402+
this[kCheckedOut].delete(connection);
403403
this.emit(ConnectionPool.CONNECTION_CHECKED_IN, new ConnectionCheckedInEvent(this, connection));
404404

405-
if (wasConnectionDeleted && willDestroy) {
405+
if (willDestroy) {
406406
const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale';
407407
this.destroyConnection(connection, reason);
408408
}

0 commit comments

Comments
 (0)