Skip to content

Commit

Permalink
remove unnecssary check in checkIn
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Nov 28, 2022
1 parent 2b6de4e commit 41c3781
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmap/connection_pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
this[kConnections].unshift(connection);
}

const wasConnectionDeleted = this[kCheckedOut].delete(connection);
this[kCheckedOut].delete(connection);
this.emit(ConnectionPool.CONNECTION_CHECKED_IN, new ConnectionCheckedInEvent(this, connection));

if (wasConnectionDeleted && willDestroy) {
if (willDestroy) {
const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale';
this.destroyConnection(connection, reason);
}
Expand Down

0 comments on commit 41c3781

Please sign in to comment.