iamaleksey commented on code in PR #4392:
URL: https://github.com/apache/cassandra/pull/4392#discussion_r2382231577
##########
src/java/org/apache/cassandra/utils/IntegerInterval.java:
##########
@@ -135,11 +138,15 @@ public static class Set
*/
public synchronized void add(int start, int end)
{
- assert start <= end;
- long[] ranges, newRanges;
- {
- ranges = this.ranges; // take local copy to avoid risk of it
changing in the midst of operation
+ this.ranges = add(this.ranges, start, end);
+ }
+ @Inline
+ public static long[] add(long[] ranges, int start, int end)
+ {
+ Invariants.require(start <= end, "%d should be strictly smaller
than %d", start, end);
Review Comment:
Invariant description is off by one.
--
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]