aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-05-28 23:05:08 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-05-28 23:05:08 +0200
commit22f2744afdfa048de7bd078ba9d24dafbcc7d7c0 (patch)
tree08393d7df1e30928b323857adfb04d535880be57 /src
parent9eaebbf575615e05e30bf4f8d7e2cf62967e7703 (diff)
Iterate over references
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/parser.y12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index 97e1a6584..78a503907 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -83,7 +83,7 @@ static void addAttr(ExprAttrs * attrs, AttrPath & attrPath,
assert(!attrPath.empty());
// Checking attrPath validity.
// ===========================
- for (i = attrPath.begin(); i + 1 < attrPath.end(); i++) {
+ for (i = attrPath.begin(); i + 1 < attrPath.end(); i++) {
if (i->symbol.set()) {
ExprAttrs::AttrDefs::iterator j = attrs->attrs.find(i->symbol);
if (j != attrs->attrs.end()) {
@@ -106,18 +106,18 @@ static void addAttr(ExprAttrs * attrs, AttrPath & attrPath,
}
// Expr insertion.
// ==========================
- if (i->symbol.set()) {
+ if (i->symbol.set()) {
ExprAttrs::AttrDefs::iterator j = attrs->attrs.find(i->symbol);
if (j != attrs->attrs.end()) {
// This attr path is already defined. However, if both
// e and the expr pointed by the attr path are two attribute sets,
// we want to merge them.
// Otherwise, throw an error.
- ExprAttrs* ae = dynamic_cast<ExprAttrs *>(e);
- ExprAttrs* jAttrs = dynamic_cast<ExprAttrs *>(j->second.e);
+ auto ae = dynamic_cast<ExprAttrs *>(e);
+ auto jAttrs = dynamic_cast<ExprAttrs *>(j->second.e);
if (jAttrs && ae) {
- for (auto ad: ae->attrs) {
- ExprAttrs::AttrDefs::iterator j2 = jAttrs->attrs.find(ad.first);
+ for (auto & ad : ae->attrs) {
+ auto j2 = jAttrs->attrs.find(ad.first);
if (j2 != jAttrs->attrs.end()) // Attr already defined in iAttrs, error.
dupAttr(ad.first, j2->second.pos, ad.second.pos);
jAttrs->attrs[ad.first] = ad.second;