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_r403723270
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/server/DataTree.java
 ##########
 @@ -758,9 +758,8 @@ public Stat statNode(String path, Watcher watcher) throws 
KeeperException.NoNode
         }
 
         int bytes = 0;
-        for (String child : children) {
-            bytes += child.length();
-        }
+        bytes = children.stream().mapToInt(child -> child.length()).sum();
 
 Review comment:
   This is not better than the original code

----------------------------------------------------------------
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

Reply via email to