Skip to content

Commit

Permalink
Don't increment next port unnecessarily
Browse files Browse the repository at this point in the history
Signed-off-by: Meredith Baxter <[email protected]>
  • Loading branch information
mbaxter committed Sep 17, 2019
1 parent 29a0e7e commit e1d38ba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public AgentBuilder keyPair(final KeyPair keyPair) {
}

public MockPeerDiscoveryAgent build() {
final int port = bindPort.orElse(nextAvailablePort.incrementAndGet());
final int port = bindPort.orElseGet(nextAvailablePort::incrementAndGet);
final DiscoveryConfiguration config = new DiscoveryConfiguration();
config.setBootnodes(bootnodes);
config.setAdvertisedHost(advertisedHost);
Expand Down

0 comments on commit e1d38ba

Please sign in to comment.