Skip to content

Commit e72fc70

Browse files
W-A-Jamesnbbeeken
authored andcommitted
remove unneeded recursion
1 parent c0fc067 commit e72fc70

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/sdam/server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,11 @@ export class Server extends TypedEventEmitter<ServerEvents> {
311311
// are waiting for a connection are included in the operation count. Load balanced
312312
// mode will only ever have a single server, so the operation count doesn't matter.
313313
// Incrementing the operation count above the logic to handle load balanced mode would
314-
// require special logic to decrement it again, or would double increment (the load
315-
// balanced code makes a recursive call). Instead, we increment the count after this
316-
// check.
314+
// require special logic to decrement it again, or would double increment. Instead, we
315+
// increment the count after this check.
317316
if (this.loadBalanced && session && conn == null && isPinnableCommand(cmd, session)) {
318317
conn = await this.pool.checkOut();
319318
session.pin(conn);
320-
return this.command(ns, cmd, finalOptions);
321319
}
322320

323321
this.incrementOperationCount();

0 commit comments

Comments
 (0)