Skip to content

Commit

Permalink
libexpr: Don't create lots of temporary strings in Bindings::lexicogr…
Browse files Browse the repository at this point in the history
…aphicOrder

Avoids ~180,000 string temporaries created when evaluating a headless
NixOS system.
  • Loading branch information
dezgeg committed Feb 19, 2018
1 parent d4e9353 commit 056d28a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libexpr/attr-set.hh
Expand Up @@ -83,7 +83,7 @@ public:
for (size_t n = 0; n < size_; n++)
res.emplace_back(&attrs[n]);
std::sort(res.begin(), res.end(), [](const Attr * a, const Attr * b) {
return (string) a->name < (string) b->name;
return (const string &) a->name < (const string &) b->name;
});
return res;
}
Expand Down

0 comments on commit 056d28a

Please sign in to comment.