summaryrefslogtreecommitdiff
path: root/src/expr
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-02-26 19:11:31 -0600
committerGitHub <noreply@github.com>2020-02-26 19:11:31 -0600
commitd41d2a817f884e0f6c8d5cb3b87b4298bc1b56f5 (patch)
tree5cfe4336c5aa40cac613238a2625b1fb4aa55d31 /src/expr
parent4b7de240edeee362a0b9ca440c22a8b0744cf34b (diff)
Initial work towards -Wshadow (#3817)
Diffstat (limited to 'src/expr')
-rw-r--r--src/expr/node.h34
-rw-r--r--src/expr/type_node.h10
2 files changed, 19 insertions, 25 deletions
diff --git a/src/expr/node.h b/src/expr/node.h
index d02cbcefd..616e256ab 100644
--- a/src/expr/node.h
+++ b/src/expr/node.h
@@ -1363,14 +1363,15 @@ NodeTemplate<ref_count>::substitute(TNode node, TNode replacement,
nb << getOperator().substitute(node, replacement, cache);
}
}
- for(const_iterator i = begin(),
- iend = end();
- i != iend;
- ++i) {
- if(*i == node) {
+ for (const_iterator it = begin(), iend = end(); it != iend; ++it)
+ {
+ if (*it == node)
+ {
nb << replacement;
- } else {
- nb << (*i).substitute(node, replacement, cache);
+ }
+ else
+ {
+ nb << (*it).substitute(node, replacement, cache);
}
}
@@ -1429,13 +1430,10 @@ NodeTemplate<ref_count>::substitute(Iterator1 nodesBegin,
replacementsBegin, replacementsEnd,
cache);
}
- for(const_iterator i = begin(),
- iend = end();
- i != iend;
- ++i) {
- nb << (*i).substitute(nodesBegin, nodesEnd,
- replacementsBegin, replacementsEnd,
- cache);
+ for (const_iterator it = begin(), iend = end(); it != iend; ++it)
+ {
+ nb << (*it).substitute(
+ nodesBegin, nodesEnd, replacementsBegin, replacementsEnd, cache);
}
Node n = nb;
cache[*this] = n;
@@ -1480,11 +1478,9 @@ NodeTemplate<ref_count>::substitute(Iterator substitutionsBegin,
// push the operator
nb << getOperator().substitute(substitutionsBegin, substitutionsEnd, cache);
}
- for(const_iterator i = begin(),
- iend = end();
- i != iend;
- ++i) {
- nb << (*i).substitute(substitutionsBegin, substitutionsEnd, cache);
+ for (const_iterator it = begin(), iend = end(); it != iend; ++it)
+ {
+ nb << (*it).substitute(substitutionsBegin, substitutionsEnd, cache);
}
Node n = nb;
cache[*this] = n;
diff --git a/src/expr/type_node.h b/src/expr/type_node.h
index 017ffe3dd..14eb9064c 100644
--- a/src/expr/type_node.h
+++ b/src/expr/type_node.h
@@ -798,12 +798,10 @@ TypeNode TypeNode::substitute(Iterator1 typesBegin,
// push the operator
nb << TypeNode(d_nv->d_children[0]);
}
- for(TypeNode::const_iterator i = begin(),
- iend = end();
- i != iend;
- ++i) {
- nb << (*i).substitute(typesBegin, typesEnd,
- replacementsBegin, replacementsEnd, cache);
+ for (TypeNode::const_iterator it = begin(), iend = end(); it != iend; ++it)
+ {
+ nb << (*it).substitute(
+ typesBegin, typesEnd, replacementsBegin, replacementsEnd, cache);
}
TypeNode tn = nb.constructTypeNode();
cache[*this] = tn;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback