mirror of
https://github.com/NixOS/nix.git
synced 2024-11-26 08:42:30 +00:00
libexpr: Don't create lots of temporary strings in Bindings::lexicographicOrder
Avoids ~180,000 string temporaries created when evaluating a headless NixOS system.
This commit is contained in:
parent
d4e93532e2
commit
056d28a601
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user