smiklosovic commented on code in PR #4785:
URL: https://github.com/apache/cassandra/pull/4785#discussion_r3187199196
##########
src/java/org/apache/cassandra/cql3/restrictions/ClusteringColumnRestrictions.java:
##########
@@ -133,25 +133,26 @@ public Slices slices(QueryOptions options) throws
InvalidRequestException
MultiCBuilder builder = new MultiCBuilder(comparator);
int keyPosition = 0;
- for (SingleRestriction r : restrictions)
- {
- if (handleInFilter(r, keyPosition))
- break;
-
- if (r.isSlice())
+ if (!restrictions.isEmpty()) // to avoid an iterator allocation
Review Comment:
I would maybe do:
if (restrictions.isEmpty())
return builder.buildSlices();
// what was there
return builder.buildSlices();
Git diff would be quite minimal and I think it just reads better.
--
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]