More accurate checking for overlapped ranges.

A RangeSet has half-closed half-open bounds. For example, "3,5" contains
blocks 3 and 4. So "3,5" and "5,7" are actually not overlapped.

Bug: 22098085
Change-Id: I362d259f8b5d62478858ad0422b635bc5068698d
(cherry picked from commit c0f56ad766)
This commit is contained in:
Tao Bao
2015-06-25 14:00:31 -07:00
parent cb9450e113
commit c3dddce205

View File

@@ -101,7 +101,7 @@ static int range_overlaps(RangeSet* r1, RangeSet* r2) {
r2_0 = r2->pos[j * 2];
r2_1 = r2->pos[j * 2 + 1];
if (!(r2_0 > r1_1 || r1_0 > r2_1)) {
if (!(r2_0 >= r1_1 || r1_0 >= r2_1)) {
return 1;
}
}