- // If we begin storing a shared_ptr in the List
- // this code can be removed. (Lgb)
- List::iterator it = list_.begin();
- List::iterator end = list_.end();
- for (; it != end; ++it) {
- delete it->inset;
+ for (auto const & ci : il) {
+ if (ci.pos < beg)
+ continue;
+ if (ci.pos >= end)
+ break;
+ // Add a new entry in the insetlist_.
+ insert(ci.inset->clone(), ci.pos - beg);