refactor(3p/nix/libexpr): Use absl::btree_map::iterator type

Instead of using a custom Args* iterator, use the one belonging to the
map type directly.
This commit is contained in:
Vincent Ambo 2020-05-22 01:54:20 +01:00
parent ee4637e3a2
commit 42205f27fc
3 changed files with 11 additions and 5 deletions

View file

@ -31,12 +31,17 @@ std::vector<const Attr*> Bindings::lexicographicOrder() {
}
Bindings::iterator Bindings::find(const Symbol& name) {
return &attributes_[name];
return attributes_.find(name);
}
Bindings::iterator Bindings::begin() { return &(attributes_.begin()->second); }
Bindings::iterator Bindings::begin() {
return attributes_.begin();
}
Bindings::iterator Bindings::end() {
return attributes_.end();
}
Bindings::iterator Bindings::end() { return &(attributes_.end()->second); }
void Bindings::merge(Bindings* other) {
// We want the values from the other attribute set to take
// precedence, but .merge() works the other way around.