From 9ed877f0a135fc48876346dc02c9d82cda2f9ea1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 7 Mar 2021 00:12:29 +0100 Subject: [PATCH] NO-OP: re-indent and reduce scope --- libs/ardour/location.cc | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc index 23e6945be9..a9997cc80f 100644 --- a/libs/ardour/location.cc +++ b/libs/ardour/location.cc @@ -1503,33 +1503,29 @@ Locations::range_starts_at(samplepos_t pos, samplecnt_t slop, bool incl) const Glib::Threads::Mutex::Lock lm(lock); Location *closest = 0; sampleoffset_t mindelta = max_samplepos; - sampleoffset_t delta; - for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) - { + for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) { + if (!(*i)->is_range_marker()) { + continue; + } - if ((*i)->is_range_marker()) - { - if (incl && (pos < (*i)->start() || pos > (*i)->end())) { - continue; - } + if (incl && (pos < (*i)->start() || pos > (*i)->end())) { + continue; + } - delta = std::abs(pos - (*i)->start()); + sampleoffset_t delta = std::abs(pos - (*i)->start()); - if (delta == 0) - { - return *i; - } + if (delta == 0) { + return *i; + } - if (delta > slop) { - continue; - } + if (delta > slop) { + continue; + } - if (delta < mindelta) - { - closest = *i; - mindelta = delta; - } + if (delta < mindelta) { + closest = *i; + mindelta = delta; } }