mirror of https://github.com/apache/cassandra
Follow up to #4411
patch by slebresne; reviewed by jbellis for CASSANDRA-4411
This commit is contained in:
parent
02030dd658
commit
35335caa03
|
|
@ -47,10 +47,10 @@ public class Bounds<T extends RingPosition> extends AbstractBounds<T>
|
|||
|
||||
public boolean contains(T position)
|
||||
{
|
||||
// Range.contains doesnt work correctly if left == right because for
|
||||
// Range that means a wrapping range that select the whole ring. So we
|
||||
// must explicitely handle this case
|
||||
return left.equals(position) || (!left.equals(right) && Range.contains(left, right, position));
|
||||
// Range.contains doesnt work correctly if left == right (unless both
|
||||
// are minimum) because for Range that means a wrapping range that select
|
||||
// the whole ring. So we must explicitely handle this case
|
||||
return left.equals(position) || ((right.isMinimum(partitioner) || !left.equals(right)) && Range.contains(left, right, position));
|
||||
}
|
||||
|
||||
public Pair<AbstractBounds<T>, AbstractBounds<T>> split(T position)
|
||||
|
|
|
|||
Loading…
Reference in New Issue