0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-15 17:16:49 +01:00

ircd::db: Fixes for reverse iteration.

This commit is contained in:
Jason Volk 2017-09-23 00:27:25 -07:00
parent 703121f867
commit 1a35514653
2 changed files with 2 additions and 5 deletions
include/ircd/db
ircd

View file

@ -175,7 +175,7 @@ ircd::db::cursor<d, tuple>::const_iterator_base<index_iterator>::const_iterator_
} }
,invalid ,invalid
{ {
!bool(this->idx) || !row.valid(this->idx->first) !this->idx || !row.valid(this->idx->first)
} }
{ {
if(invalid) if(invalid)

View file

@ -1800,10 +1800,7 @@ ircd::db::index::rbegin(const string_view &key,
opts |= get::NO_CACHE; opts |= get::NO_CACHE;
if(seek(ret, key, opts)) if(seek(ret, key, opts))
{ seek(ret, pos::BACK, opts);
while(seek(ret, pos::NEXT, opts));
seek(ret, pos::PREV, opts);
}
return ret; return ret;
} }