afs commented on code in PR #3047:
URL: https://github.com/apache/jena/pull/3047#discussion_r1983073311
##########
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:
Maybe it does not matter with this destructive operation but the cost of
`stream()` is not trivial.
`forEach` does not use `stream`.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]