1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

optimize removeAttrs builtin

use a sorted array of symbols to be removed instead of a set. this saves a lot
of memory allocations and slightly speeds up removal.
This commit is contained in:
pennae 2022-01-02 00:41:21 +01:00
parent 6401e443a4
commit c9fc975259
2 changed files with 20 additions and 7 deletions

View file

@ -121,6 +121,8 @@ class BindingsBuilder
Bindings * bindings;
public:
// needed by std::back_inserter
using value_type = Attr;
EvalState & state;
@ -134,6 +136,11 @@ public:
}
void insert(const Attr & attr)
{
push_back(attr);
}
void push_back(const Attr & attr)
{
bindings->push_back(attr);
}