about summary refs log tree commit diff
path: root/third_party/nix/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix-env/nix-env.cc')
-rw-r--r--third_party/nix/src/nix-env/nix-env.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/third_party/nix/src/nix-env/nix-env.cc b/third_party/nix/src/nix-env/nix-env.cc
index 93a8e4c1ecdb..a645fa31489c 100644
--- a/third_party/nix/src/nix-env/nix-env.cc
+++ b/third_party/nix/src/nix-env/nix-env.cc
@@ -1209,13 +1209,12 @@ static void opQuery(Globals& globals, Strings opFlags, Strings opArgs) {
                   attrs2["type"] = "strings";
                   XMLOpenElement m(xml, "meta", attrs2);
                   Bindings& attrs = *v->attrs;
-                  for (auto& i : attrs) {
-                    Attr& a(*attrs.find(i.name));
+                  for (auto& [name, a] : attrs) {
                     if (a.value->type != tString) {
                       continue;
                     }
                     XMLAttrs attrs3;
-                    attrs3["type"] = i.name;
+                    attrs3["type"] = name;
                     attrs3["value"] = a.value->string.s;
                     xml.writeEmptyElement("string", attrs3);
                   }