From: Amos Jeffries <> Date: Wed, 12 Apr 2017 00:07:55 +0000 (+1200) Subject: Cleanup: convert ACLIntRange loops to range-for X-Git-Tag: M-staged-PR71~198 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=40ab18576e0d90eb04d40c9c53a000e734906f45;p=thirdparty%2Fsquid.git Cleanup: convert ACLIntRange loops to range-for --- diff --git a/src/acl/IntRange.cc b/src/acl/IntRange.cc index 557aa929a7..f4e04d55ad 100644 --- a/src/acl/IntRange.cc +++ b/src/acl/IntRange.cc @@ -55,10 +55,8 @@ bool ACLIntRange::match(int i) { RangeType const toFind(i, i+1); - for (std::list::const_iterator iter = ranges.begin(); iter != ranges.end(); ++iter) { - const RangeType & element = *iter; + for (const auto &element : ranges) { RangeType result = element.intersection(toFind); - if (result.size()) return true; } @@ -82,9 +80,8 @@ SBufList ACLIntRange::dump() const { SBufList sl; - for (std::list::const_iterator iter = ranges.begin(); iter != ranges.end(); ++iter) { + for (const auto &element : ranges) { SBuf sb; - const RangeType & element = *iter; if (element.size() == 1) sb.Printf("%d", element.start);