auto p = m.lower_bound(start); // p->first >= start
if (p != m.begin() &&
(p == m.end() || p->first > start)) {
- p--; // might overlap?
+ --p; // might overlap?
if (p->first + p->second <= start)
- p++; // it doesn't.
+ ++p; // it doesn't.
}
return p;
}
auto p = m.lower_bound(start);
if (p != m.begin() &&
(p == m.end() || p->first > start)) {
- p--; // might overlap?
+ --p; // might overlap?
if (p->first + p->second <= start)
- p++; // it doesn't.
+ ++p; // it doesn't.
}
return p;
}
auto p = m.lower_bound(start);
if (p != m.begin() &&
(p == m.end() || p->first > start)) {
- p--; // might touch?
+ --p; // might touch?
if (p->first + p->second < start)
- p++; // it doesn't.
+ ++p; // it doesn't.
}
return p;
}
auto p = m.lower_bound(start);
if (p != m.begin() &&
(p == m.end() || p->first > start)) {
- p--; // might touch?
+ --p; // might touch?
if (p->first + p->second < start)
- p++; // it doesn't.
+ ++p; // it doesn't.
}
return p;
}
p->second += len; // append to end
auto n = p;
- n++;
+ ++n;
if (pstart)
*pstart = p->first;
if (n != m.end() &&