Ignore:
Timestamp:
Oct 27, 2014, 2:46:11 PM (7 years ago)
Author:
Peter
Message:

use better hint; remove ws

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/SegmentSet.h

    r2820 r3337  
    6161       segment and neighboring segments the segments are merged.
    6262     */
    63     typename me::const_iterator 
     63    typename me::const_iterator
    6464    insert_merge(const typename me::value_type& segment)
    6565    {
    66       std::pair<typename me::iterator, typename me::iterator> p = 
     66      std::pair<typename me::iterator, typename me::iterator> p =
    6767        this->overlap_range(segment);
    6868      if (p.first==p.second) { // no overlap between set and segment
     
    7272        p.first           last         p.second
    7373        --->    --->      --->         --->
    74        
     74
    7575        ----------------------->
    7676        segment
     
    8282      --last;
    8383      YAT_ASSERT(compare_3way(segment, *last)==0);
    84      
    85       Segment<T, Compare> segment2(std::min(p.first->begin(),
    86                                             segment.begin(), comp),
    87                                   std::max(last->end(), segment.end(), comp));
    88       this->container_.erase(p.first, p.second);
    89       // FIXME: use a better hint than end()
    90       return this->container_.insert(this->end(), segment2);
     84
     85      Segment<T, Compare>
     86        segment2(std::min(p.first->begin(), segment.begin(), comp),
     87                std::max(last->end(), segment.end(), comp));
     88
     89      this->container_.erase(p.first, p.second);
     90      return this->container_.insert(p.second, segment2);
    9191    }
    9292
Note: See TracChangeset for help on using the changeset viewer.