Logarithmic note seek for Sequence iterator.

git-svn-id: svn://localhost/ardour2/branches/3.0@5803 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-10-19 16:23:08 +00:00
parent 70ad8b059a
commit a86b994c68

View file

@ -100,13 +100,8 @@ Sequence<Time>::const_iterator::const_iterator(const Sequence<Time>& seq, Time t
seq.read_lock(); seq.read_lock();
// Find first note which begins after t // Find first note which begins after t
for (typename Sequence<Time>::Notes::const_iterator i = seq.notes().begin(); boost::shared_ptr< Note<Time> > search_note(new Note<Time>(0, t, 0, 0, 0));
i != seq.notes().end(); ++i) { _note_iter = seq.notes().lower_bound(search_note);
if ((*i)->time() >= t) {
_note_iter = i;
break;
}
}
assert(_note_iter == seq.notes().end() || (*_note_iter)->time() >= t); assert(_note_iter == seq.notes().end() || (*_note_iter)->time() >= t);
// Find first sysex event after t // Find first sysex event after t