xo-arena: bugfix: backwards iteration working now

This commit is contained in:
Roland Conybeare 2026-01-08 18:20:27 -05:00
commit 6f0b45c429
3 changed files with 84 additions and 1 deletions

View file

@ -379,6 +379,19 @@ namespace xo {
return *this;
}
DArenaHashMapIterator & operator--() {
/* simpler than forward iteration, since bookend immediately
* precedes control byte for first slot
*/
do {
--ctrl_;
--pos_;
} while (is_sentinel(*ctrl_)
&& (*ctrl_ != c_iterator_bookend));
return *this;
}
private:
uint8_t * ctrl_ = nullptr;
value_type * pos_ = nullptr;