From 2a200bdc0ead3d2a2a0481db44b0bc080529aa69 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 3 Jan 2012 18:43:58 +0000 Subject: return two iterators into the Bars|Beats list of the tempo map rather than making a copy; use iterators in the GUI git-svn-id: svn://localhost/ardour2/branches/3.0@11146 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/tempo.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'libs/ardour/tempo.cc') diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 457e324c73..0dd5634f95 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1409,21 +1409,16 @@ TempoMap::round_to_type (framepos_t frame, int dir, BBTPointType type) } void -TempoMap::map (TempoMap::BBTPointList& points, framepos_t lower, framepos_t upper) +TempoMap::map (TempoMap::BBTPointList::const_iterator& begin, + TempoMap::BBTPointList::const_iterator& end, + framepos_t lower, framepos_t upper) { if (_map.empty() || upper >= _map.back().frame) { recompute_map (false, upper); } - for (BBTPointList::const_iterator i = _map.begin(); i != _map.end(); ++i) { - if ((*i).frame < lower) { - continue; - } - if ((*i).frame >= upper) { - break; - } - points.push_back (*i); - } + begin = lower_bound (_map.begin(), _map.end(), lower); + end = upper_bound (_map.begin(), _map.end(), upper); } const TempoSection& -- cgit v1.2.3