]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/acl/IntRange.cc
Docs: Copyright updates for 2018 (#114)
[thirdparty/squid.git] / src / acl / IntRange.cc
index 3bd8b11c3aa2899be8b7ddf8b0e10b582111509b..e2d1d3840c1cc285b02e69700e51fd2cc351505b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -11,6 +11,7 @@
 #include "squid.h"
 #include "acl/IntRange.h"
 #include "cache_cf.h"
+#include "ConfigParser.h"
 #include "Debug.h"
 #include "fatal.h"
 #include "Parsing.h"
@@ -18,9 +19,7 @@
 void
 ACLIntRange::parse()
 {
-    char *a;
-
-    while ((a = strtokFile())) {
+    while (char *a = ConfigParser::strtokFile()) {
         char *b = strchr(a, '-');
         unsigned short port1, port2;
 
@@ -56,10 +55,8 @@ bool
 ACLIntRange::match(int i)
 {
     RangeType const toFind(i, i+1);
-    for (std::list<RangeType>::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;
     }
@@ -83,9 +80,8 @@ SBufList
 ACLIntRange::dump() const
 {
     SBufList sl;
-    for (std::list<RangeType>::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);