@@ -949,48 +949,6 @@ SortedDisjointIntervalList::Iterator SortedDisjointIntervalList::InsertInterval(
949949 return it;
950950}
951951
952- SortedDisjointIntervalList::Iterator SortedDisjointIntervalList::GrowRightByOne (
953- int64_t value, int64_t * newly_covered) {
954- auto it = intervals_.upper_bound ({value, kint64max});
955- auto it_prev = it;
956-
957- // No interval containing or adjacent to "value" on the left (i.e. below).
958- if (it != begin ()) {
959- --it_prev;
960- }
961- if (it == begin () || ((value != kint64min) && it_prev->end < value - 1 )) {
962- *newly_covered = value;
963- if (it == end () || it->start != value + 1 ) {
964- // No interval adjacent to "value" on the right: insert a singleton.
965- return intervals_.insert (it, {value, value});
966- } else {
967- // There is an interval adjacent to "value" on the right. Extend it by
968- // one. Note that we already know that there won't be a merge with another
969- // interval on the left, since there were no interval adjacent to "value"
970- // on the left.
971- DCHECK_EQ (it->start , value + 1 );
972- const_cast <ClosedInterval*>(&(*it))->start = value;
973- return it;
974- }
975- }
976-
977- // At this point, "it_prev" points to an interval containing or adjacent to
978- // "value" on the left: grow it by one, and if it now touches the next
979- // interval, merge with it.
980- CHECK_NE (kint64max, it_prev->end ) << " Cannot grow right by one: the interval "
981- " that would grow already ends at "
982- " kint64max" ;
983- *newly_covered = it_prev->end + 1 ;
984- if (it != end () && it_prev->end + 2 == it->start ) {
985- // We need to merge it_prev with 'it'.
986- const_cast <ClosedInterval*>(&(*it_prev))->end = it->end ;
987- intervals_.erase (it);
988- } else {
989- const_cast <ClosedInterval*>(&(*it_prev))->end = it_prev->end + 1 ;
990- }
991- return it_prev;
992- }
993-
994952template <class T >
995953void SortedDisjointIntervalList::InsertAll (const std::vector<T>& starts,
996954 const std::vector<T>& ends) {
0 commit comments