diff options
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/nix/src/libexpr/attr-set.cc | 23 | ||||
-rw-r--r-- | third_party/nix/src/libexpr/attr-set.hh | 3 |
2 files changed, 0 insertions, 26 deletions
diff --git a/third_party/nix/src/libexpr/attr-set.cc b/third_party/nix/src/libexpr/attr-set.cc index 0c8dc0baa42e..c5cfbf3caf5f 100644 --- a/third_party/nix/src/libexpr/attr-set.cc +++ b/third_party/nix/src/libexpr/attr-set.cc @@ -66,7 +66,6 @@ class BTreeBindings : public Bindings { size_t size() override; bool empty() override; void push_back(const Attr& attr) override; - void insert_or_assign(Attr& attr) override; Bindings::iterator find(const Symbol& name) override; Bindings::iterator begin() override; Bindings::iterator end() override; @@ -96,11 +95,6 @@ void BTreeBindings::push_back(const Attr& attr) { } } -// Insert or assign (i.e. replace) a value in the attribute set. -void BTreeBindings::insert_or_assign(Attr& attr) { - attributes_.insert_or_assign(attr.name, attr); -} - size_t BTreeBindings::size() { return attributes_.size(); } bool BTreeBindings::empty() { return attributes_.empty(); } @@ -144,7 +138,6 @@ class VectorBindings : public Bindings { size_t size() override; bool empty() override; void push_back(const Attr& attr) override; - void insert_or_assign(Attr& attr) override; Bindings::iterator find(const Symbol& name) override; Bindings::iterator begin() override; Bindings::iterator end() override; @@ -159,22 +152,6 @@ size_t VectorBindings::size() { return attributes_.size(); } bool VectorBindings::empty() { return attributes_.empty(); } -// Insert or assign (i.e. replace) a value in the attribute set. -void VectorBindings::insert_or_assign(Attr& attr) { - for (auto it = attributes_.begin(); it != attributes_.end(); ++it) { - if (it->first == attr.name) { - it->second = attr; - return; - } else if (attr.name < it->first) { - // TODO convert to BTreeMap if we get big enough - attributes_.emplace(it, attr.name, attr); - return; - } - } - - attributes_.emplace_back(attr.name, attr); -} - void VectorBindings::merge(Bindings& other) { AttributeVector new_attributes; new_attributes.reserve(size() + other.size()); diff --git a/third_party/nix/src/libexpr/attr-set.hh b/third_party/nix/src/libexpr/attr-set.hh index 55641a020325..795ee2337fc7 100644 --- a/third_party/nix/src/libexpr/attr-set.hh +++ b/third_party/nix/src/libexpr/attr-set.hh @@ -80,9 +80,6 @@ class Bindings { // Insert, but do not replace, values in the attribute set. virtual void push_back(const Attr& attr) = 0; - // Insert a value, or replace an existing one. - virtual void insert_or_assign(Attr& attr) = 0; - // Look up a specific element of the attribute set. virtual iterator find(const Symbol& name) = 0; |