about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 50997e096fd1..43f3161f8baf 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -200,15 +200,12 @@ string showAttrPath(const AttrPath & attrPath)
 {
     std::ostringstream out;
     bool first = true;
-    foreach (AttrPath::const_iterator, i, attrPath) {
-        if (!first)
-            out << '.';
+    for (auto & i : attrPath) {
+        if (!first) out << '.'; else first = false;
+        if (i.symbol.set())
+            out << i.symbol;
         else
-            first = false;
-        if (i->symbol.set())
-            out << i->symbol;
-        else
-            out << "\"${" << *i->expr << "}\"";
+            out << "\"${" << *i.expr << "}\"";
     }
     return out.str();
 }