]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Convert Acl::InnerNode to C++11 for-each loop (#101)
authorAmos Jeffries <yadij@users.noreply.github.com>
Fri, 15 Dec 2017 02:50:53 +0000 (15:50 +1300)
committerGitHub <noreply@github.com>
Fri, 15 Dec 2017 02:50:53 +0000 (15:50 +1300)
This also fixes a bug in some STL implementations where passing for_each &ACL::prepareForUse
results in the ACL class nil-method explicitly running instead of the child ACL class
virtual method.

src/acl/InnerNode.cc

index 33ca0cbf47e45c3184e26c7da2388b62add00cf5..a5ec2e944405bf1298d718335b9320c76844a77a 100644 (file)
@@ -21,7 +21,8 @@
 void
 Acl::InnerNode::prepareForUse()
 {
-    std::for_each(nodes.begin(), nodes.end(), std::mem_fun(&ACL::prepareForUse));
+    for (auto node : nodes)
+        node->prepareForUse();
 }
 
 bool