Github user eribeiro commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/476#discussion_r182127687
--- Diff:
src/java/main/org/apache/zookeeper/server/quorum/FastLeaderElection.java ---
@@ -927,10 +927,11 @@ public Vote lookForLeader() throws
InterruptedException {
tmpTimeOut : maxNotificationInterval);
LOG.info("Notification time out: " + notTimeout);
}
- else if
(self.getCurrentAndNextConfigVoters().contains(n.sid)) {
+ else if
(self.getCurrentAndNextConfigVoters().contains(n.sid) &&
--- End diff --
As this PR modifies this line and add similar ones, wouldn't be the case of
creating a private method with a meaningful name like below?
```
private boolean configVotersContains(long sid) {
return self.getCurrentAndNextConfigVoters().contains(sid);
}
```
This makes this line and the lines below more readable, imho.
---