diff --git a/include/ircd/db/cursor.h b/include/ircd/db/cursor.h index 75800d177..94aba9eb5 100644 --- a/include/ircd/db/cursor.h +++ b/include/ircd/db/cursor.h @@ -175,7 +175,7 @@ ircd::db::cursor<d, tuple>::const_iterator_base<index_iterator>::const_iterator_ } ,invalid { - !bool(this->idx) || !row.valid(this->idx->first) + !this->idx || !row.valid(this->idx->first) } { if(invalid) diff --git a/ircd/db.cc b/ircd/db.cc index 9d97914a7..c0b7303e9 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -1800,10 +1800,7 @@ ircd::db::index::rbegin(const string_view &key, opts |= get::NO_CACHE; if(seek(ret, key, opts)) - { - while(seek(ret, pos::NEXT, opts)); - seek(ret, pos::PREV, opts); - } + seek(ret, pos::BACK, opts); return ret; }