Skip to content

Commit 79e3f6d

Browse files
move comment
1 parent ed58724 commit 79e3f6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sdam/topology.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,13 @@ function processWaitQueue(topology: Topology) {
904904
} else if (selectedDescriptions.length === 1) {
905905
selectedServer = topology.s.servers.get(selectedDescriptions[0].address);
906906
} else if (selectedDescriptions.length === 2) {
907-
// If there are only two servers, we avoid shuffling the array of
908-
// server descriptions
909907
const server1 = topology.s.servers.get(selectedDescriptions[0].address);
910908
const server2 = topology.s.servers.get(selectedDescriptions[1].address);
911909

912910
if (server1 && server2) {
913911
if (server1.s.operationCount === server2.s.operationCount) {
912+
// If there are only two servers, we avoid shuffling the array of
913+
// server descriptions
914914
selectedServer = Math.floor(Math.random() * 2) === 0 ? server1 : server2;
915915
} else {
916916
selectedServer = server1.s.operationCount < server2.s.operationCount ? server1 : server2;

0 commit comments

Comments
 (0)