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:
parent
6401e443a4
commit
c9fc975259
2 changed files with 20 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue