Skip to content

Commit 1b29799

Browse files
committed
fix KeyRangeRef::isCovered()
1 parent 2890b99 commit 1b29799

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fdbclient/include/fdbclient/FDBTypes.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,11 @@ struct KeyRangeRef {
342342
return false; // uncovered gap between clone.begin and r.begin
343343
if (clone.end <= r.end)
344344
return true; // range is fully covered
345-
if (clone.end > r.begin)
345+
// If a range of ranges is totally at the left of clone,
346+
// clone needs not update
347+
// If a range of ranges is partially at the left of clone,
348+
// clone = clone - the overlap
349+
if (clone.end > r.end && r.end > clone.begin)
346350
// {clone.begin, r.end} is covered. need to check coverage for {r.end, clone.end}
347351
clone = KeyRangeRef(r.end, clone.end);
348352
}

0 commit comments

Comments
 (0)