rvesse commented on code in PR #3047:
URL: https://github.com/apache/jena/pull/3047#discussion_r1982972317


##########
jena-arq/src/main/java/org/apache/jena/sparql/exec/RowSetOps.java:
##########
@@ -51,7 +51,7 @@ public static void consume(RowSet rowSet)
      * This operation consumes the RowSet.
      */
     public static long count(RowSet rowSet)
-    { return rowSet.rewindable().size(); }
+    { long c[] = {0}; rowSet.forEach(b -> ++c[0]); return c[0]; }

Review Comment:
   Or maybe `rowSet.stream().count()` would be cleaner and still avoid the 
memory copy (though it has conversion to `Stream` overhead?



-- 
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: pr-unsubscr...@jena.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org
For additional commands, e-mail: pr-h...@jena.apache.org

Reply via email to