krummas commented on a change in pull request #898:
URL: https://github.com/apache/cassandra/pull/898#discussion_r578365558
##########
File path: src/java/org/apache/cassandra/db/Slice.java
##########
@@ -212,7 +217,12 @@ public Slice forPaging(ClusteringComparator comparator,
Clustering<?> lastReturn
if (cmp < 0 || (inclusive && cmp == 0))
return this;
- return new Slice(inclusive ?
ClusteringBound.inclusiveStartOf(lastReturned) :
ClusteringBound.exclusiveStartOf(lastReturned), end);
+ ClusteringBound<?> nextStart = inclusive ?
ClusteringBound.inclusiveStartOf(lastReturned) :
ClusteringBound.exclusiveStartOf(lastReturned);
+
+ if (isEmpty(comparator, nextStart, end))
Review comment:
same but with `end`^
##########
File path: src/java/org/apache/cassandra/db/Slice.java
##########
@@ -200,7 +200,12 @@ public Slice forPaging(ClusteringComparator comparator,
Clustering<?> lastReturn
if (cmp < 0 || (inclusive && cmp == 0))
return this;
- return new Slice(start, inclusive ?
ClusteringBound.inclusiveEndOf(lastReturned) :
ClusteringBound.exclusiveEndOf(lastReturned));
+ ClusteringBound<?> nextEnd = inclusive ?
ClusteringBound.inclusiveEndOf(lastReturned) :
ClusteringBound.exclusiveEndOf(lastReturned);
+
+ if (isEmpty(comparator, start, nextEnd))
Review comment:
suggestion, not entirely sure it makes things clearer, but maybe bake
this in the `cmp` check above - we can return null if `cmp == 0 &&
(!isInclusive || !start.isInclusive())` I think?
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]