diff options
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r-- | src/libexpr/get-drvs.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index db91eab37156..1c9fa02a366a 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -161,12 +161,12 @@ void DrvInfo::setMeta(const string & name, Value * v) { getMeta(); Bindings * old = meta; - meta = new Bindings(); + meta = state->allocBindings(1 + (old ? old->size() : 0)); Symbol sym = state->symbols.create(name); if (old) - foreach (Bindings::iterator, i, *old) - if (i->name != sym) - meta->push_back(*i); + for (auto i : *old) + if (i.name != sym) + meta->push_back(i); if (v) meta->push_back(Attr(sym, v)); meta->sort(); } |