mino181295 opened a new pull request #1538:
URL: https://github.com/apache/zookeeper/pull/1538
```
public synchronized void processSync(LearnerSyncRequest r) {
if (outstandingProposals.isEmpty()) {
sendSync(r);
} else {
List<LearnerSyncRequest> l = pendingSyncs.get(lastProposed);
if (l == null) {
l = new ArrayList<LearnerSyncRequest>();
}
l.add(r);
pendingSyncs.put(lastProposed, l);
}
}
```
we can use the computeIfAbsent to make the code more clean and elegant
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]