eolivelli commented on a change in pull request #1306: ZOOKEEPER-3415: Convert
internal logic to use streams
URL: https://github.com/apache/zookeeper/pull/1306#discussion_r404605791
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
##########
@@ -227,11 +230,7 @@ public int getWatchCount() {
}
public int getEphemeralsCount() {
- int result = 0;
- for (HashSet<String> set : ephemerals.values()) {
- result += set.size();
- }
- return result;
+ return ephemerals.values().stream().mapToInt(i -> i.size()).sum();
Review comment:
what's the value of this change ?
----------------------------------------------------------------
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]
With regards,
Apache Git Services