Make ControlList::paste const-correct.

This commit is contained in:
David Robillard 2014-11-15 18:53:53 -05:00
parent 8793e60af2
commit 9d4f43fa7d
2 changed files with 3 additions and 3 deletions

View file

@ -1619,7 +1619,7 @@ ControlList::clear (double start, double end)
/** @param pos Position in model coordinates */
bool
ControlList::paste (ControlList& alist, double pos, float /*times*/)
ControlList::paste (const ControlList& alist, double pos, float /*times*/)
{
if (alist._events.empty()) {
return false;
@ -1634,7 +1634,7 @@ ControlList::paste (ControlList& alist, double pos, float /*times*/)
where = upper_bound (_events.begin(), _events.end(), &cp, time_comparator);
for (iterator i = alist.begin();i != alist.end(); ++i) {
for (const_iterator i = alist.begin();i != alist.end(); ++i) {
_events.insert (where, new ControlEvent( (*i)->when+pos,( *i)->value));
end = (*i)->when + pos;
}