forked from lix-project/lix
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++)
|
for (size_t n = 0; n < size_; n++)
|
||||||
res.emplace_back(&attrs[n]);
|
res.emplace_back(&attrs[n]);
|
||||||
std::sort(res.begin(), res.end(), [](const Attr * a, const Attr * b) {
|
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;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue