about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/attr-set.hh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-22T23·52+0100
committerVincent Ambo <tazjin@google.com>2020-05-22T23·52+0100
commit6b447f4b259e929faf0add0cf0ad36309a7ec13d (patch)
tree23df784b690954c5277182832158800fed792668 /third_party/nix/src/libexpr/attr-set.hh
parent8c28be1b69a66f16fd1c711931b5a6f6948a8a2a (diff)
chore(3p/nix/libexpr): Expose separate insert & "upsert" methods r/818
Reading more through the old code, it seems like the intention
/sometimes/ is to replace values.
Diffstat (limited to 'third_party/nix/src/libexpr/attr-set.hh')
-rw-r--r--third_party/nix/src/libexpr/attr-set.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/nix/src/libexpr/attr-set.hh b/third_party/nix/src/libexpr/attr-set.hh
index 5837b5cbdc9c..6b68b4664a09 100644
--- a/third_party/nix/src/libexpr/attr-set.hh
+++ b/third_party/nix/src/libexpr/attr-set.hh
@@ -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);