chore(3p/nix/libexpr): Expose separate insert & "upsert" methods

Reading more through the old code, it seems like the intention
/sometimes/ is to replace values.
This commit is contained in:
Vincent Ambo 2020-05-23 00:52:20 +01:00
parent 8c28be1b69
commit 6b447f4b25
2 changed files with 10 additions and 3 deletions

View file

@ -50,10 +50,12 @@ class Bindings {
// Is this attribute set empty?
bool empty();
// TODO(tazjin): rename
// TODO(tazjin): does this need to copy?
// Insert, but do not replace, values in the attribute set.
void push_back(const Attr& attr);
// Insert a value, or replace an existing one.
void insert_or_assign(const Attr& attr);
// Look up a specific element of the attribute set.
iterator find(const Symbol& name);