File tree 1 file changed +2
-9
lines changed
server/src/main/java/org/elasticsearch/cluster/coordination
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -338,15 +338,8 @@ public void handleResponse(PeersResponse response) {
338
338
339
339
peersRequestInFlight = false ;
340
340
341
- if (response .getMasterNode ().isPresent ()) {
342
- final DiscoveryNode masterNode = response .getMasterNode ().get ();
343
- if (masterNode .equals (discoveryNode ) == false ) {
344
- startProbe (masterNode .getAddress ());
345
- }
346
- } else {
347
- response .getKnownPeers ().stream ().map (DiscoveryNode ::getAddress )
348
- .forEach (PeerFinder .this ::startProbe );
349
- }
341
+ response .getMasterNode ().map (DiscoveryNode ::getAddress ).ifPresent (PeerFinder .this ::startProbe );
342
+ response .getKnownPeers ().stream ().map (DiscoveryNode ::getAddress ).forEach (PeerFinder .this ::startProbe );
350
343
}
351
344
352
345
if (response .getMasterNode ().equals (Optional .of (discoveryNode ))) {
You can’t perform that action at this time.
0 commit comments