i = std::upper_bound(i, ie, j->start);
if (i != ranges.begin()) --i;
} else if (j->start < i->start) {
- if ((++StartPos)->start <= i->start) {
+ ++StartPos;
+ if (StartPos != other.end() && StartPos->start <= i->start) {
+ assert(StartPos < other.end() && i < end());
j = std::upper_bound(j, je, i->start);
if (j != other.ranges.begin()) --j;
}
return true;
}
- while (i != ie && j != je) {
- if (i->start == j->start)
- return true;
+ if (j == je) return false;
+ while (i != ie) {
if (i->start > j->start) {
std::swap(i, j);
std::swap(ie, je);
}
- assert(i->start < j->start);
if (i->end > j->start)
return true;