fix(3p/nix/libexpr): Fix post-increment operator in BindingsIterator

We accidentally returned the incremented iterator in the
post-increment, this fixes it.

Paired-With: Luke Granger-Brown <git@lukegb.com>
Paired-With: Vincent Ambo <mail@tazj.in>
Paired-With: Perry Lorier <isomer@tvl.fyi>
Change-Id: I36c79eb56359bb12a78ad3489e7d7d2eb2053510
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1140
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Reviewed-by: glittershark <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2020-07-14 00:28:56 +01:00 committed by tazjin
parent 785ca36316
commit d94690b537

View file

@ -23,12 +23,13 @@ BindingsIterator& BindingsIterator::operator++() {
}
BindingsIterator BindingsIterator::operator++(int) {
auto old = *this;
std::visit(util::overloaded{
[](AttributeMap::iterator& iter) { iter++; },
[](AttributeVector::iterator& iter) { iter++; },
},
_iterator);
return *this;
return old;
}
bool BindingsIterator::operator==(const BindingsIterator& other) const {