Skip to content

Commit

Permalink
Optimize single provider case. (#8002)
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericasgeertsen <[email protected]>
  • Loading branch information
spericas authored Nov 20, 2023
1 parent dc4db18 commit ea3e55c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ public Optional<ProxyProtocolData> proxyProtocolData() {
}

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 ea3e55c

Please sign in to comment.