diff options
author | David Robillard <d@drobilla.net> | 2009-10-19 16:23:08 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-19 16:23:08 +0000 |
commit | a86b994c683b981c395f829082abef67add2424a (patch) | |
tree | 3c975b57480f66fb70e2c6b49b2228d0b2ce5a71 | |
parent | 70ad8b059a0552a8ec60973861ec1c4b6c130cc9 (diff) |
Logarithmic note seek for Sequence iterator.
git-svn-id: svn://localhost/ardour2/branches/3.0@5803 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index 81d515afbf..e27668e626 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -100,13 +100,8 @@ Sequence<Time>::const_iterator::const_iterator(const Sequence<Time>& seq, Time t seq.read_lock(); // Find first note which begins after t - for (typename Sequence<Time>::Notes::const_iterator i = seq.notes().begin(); - i != seq.notes().end(); ++i) { - if ((*i)->time() >= t) { - _note_iter = i; - break; - } - } + boost::shared_ptr< Note<Time> > search_note(new Note<Time>(0, t, 0, 0, 0)); + _note_iter = seq.notes().lower_bound(search_note); assert(_note_iter == seq.notes().end() || (*_note_iter)->time() >= t); // Find first sysex event after t |