Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0f56ad7 authored by Tao Bao's avatar Tao Bao
Browse files

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: I75e54a6506f2a20255d782ee710e889fad2eaf29
parent ec18d495
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -162,7 +162,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;
            }
        }