jelmini commented on a change in pull request #442:
URL: https://github.com/apache/jackrabbit-oak/pull/442#discussion_r770659776



##########
File path: 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/ClusterView.java
##########
@@ -187,22 +187,13 @@ private String asJson(final long viewSeqNum, final 
boolean viewFinal, final Stri
         builder.key("id").value(clusterId);
         builder.key("me").value(localId);
         builder.key("active").array();
-        for (Iterator<Integer> it = activeIds.iterator(); it.hasNext();) {

Review comment:
       A potential alternative:
   `activeIds.stream().sorted().forEachOrdered(builder::value);`
   The `sorted()` operator achieves the same than the `TreeSet`. 
   Usually, `forEach()` and `forEachOrdered()` should have the same behaviour 
with a sequential stream, but in theory `forEach()` behaviour  is undefined, 
because in case of a parallel stream it could apply items in any order.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to