Skip to content

Commit

Permalink
Optimize single provider case.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericasgeertsen <[email protected]>
  • Loading branch information
spericas committed Nov 14, 2023
1 parent 4053d1b commit 223bddf
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,11 @@ public Router router() {
}

private ServerConnection identifyConnection() {
// if just one candidate, take a chance with it
if (providerCandidates.size() == 1) {
return providerCandidates.getFirst().connection(this);
}

try {
reader.ensureAvailable();
} catch (DataReader.InsufficientDataAvailableException e) {
Expand Down

0 comments on commit 223bddf

Please sign in to comment.