aweisberg commented on code in PR #3777:
URL: https://github.com/apache/cassandra/pull/3777#discussion_r1915504876
##########
src/java/org/apache/cassandra/dht/NormalizedRanges.java:
##########
@@ -201,8 +204,7 @@ else if (!bRMin && aRange.left.compareTo(bRange.right) >= 0)
@VisibleForTesting
public NormalizedRanges<T> invert()
{
- if (isEmpty())
- return this;
+ checkState(!isEmpty());
Review Comment:
Returning `this` is just the wrong answer which I did manage to encounter.
This has pretty narrow usage (only used in `subtract`) where inverting an
empty set of normalized ranges isn't needed and it's not possible to invert
because you don't know what partitioner to use since it's empty and there are
no tokens that link you to the correct partitioner.
I should change it to package private.
--
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]