diff --git a/include/ircd/db/cell.h b/include/ircd/db/cell.h index 3f8e454c7..16f869d81 100644 --- a/include/ircd/db/cell.h +++ b/include/ircd/db/cell.h @@ -86,7 +86,7 @@ struct ircd::db::cell cell(column, const string_view &index = {}, const gopts & = {}); cell(database &, const string_view &column, const string_view &index, const gopts & = {}); cell(database &, const string_view &column, const gopts & = {}); - cell(); + cell() noexcept; cell(cell &&) noexcept; cell(const cell &) = delete; cell &operator=(cell &&) noexcept; @@ -146,3 +146,10 @@ const { return val(); } + +inline bool +ircd::db::cell::valid() +const +{ + return it && db::valid(*it); +} diff --git a/include/ircd/db/column_iterator.h b/include/ircd/db/column_iterator.h index 46d2c02e6..8f8feb8b2 100644 --- a/include/ircd/db/column_iterator.h +++ b/include/ircd/db/column_iterator.h @@ -51,8 +51,8 @@ struct ircd::db::column::const_iterator_base explicit operator database::snapshot &(); explicit operator gopts &(); - operator bool() const noexcept; - bool operator!() const noexcept; + operator bool() const; + bool operator!() const; const value_type *operator->() const; const value_type &operator*() const; @@ -101,11 +101,18 @@ const inline bool ircd::db::column::const_iterator_base::operator!() -const noexcept +const { return !static_cast(*this); } +inline ircd::db::column::const_iterator_base::operator +bool() +const +{ + return it && valid(*it); +} + inline ircd::db::column::const_iterator_base::operator gopts &() { diff --git a/ircd/db.cc b/ircd/db.cc index c05acfd82..aebc7ac0c 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -2146,7 +2146,9 @@ template bool ircd::db::seek(cell &, const pos &, gopts); template bool ircd::db::seek(cell &, const string_view &, gopts); // Linkage for incomplete rocksdb::Iterator +[[gnu::hot]] ircd::db::cell::cell() +noexcept { } @@ -2235,6 +2237,7 @@ noexcept } // Linkage for incomplete rocksdb::Iterator +[[gnu::hot]] ircd::db::cell::~cell() noexcept { @@ -2334,13 +2337,6 @@ const return valid() && db::valid_lte(*it, s); } -bool -ircd::db::cell::valid() -const -{ - return bool(it) && db::valid(*it); -} - /////////////////////////////////////////////////////////////////////////////// // // db/domain.h @@ -3681,18 +3677,6 @@ const return val; } -ircd::db::column::const_iterator_base::operator bool() -const noexcept -{ - if(!it) - return false; - - if(!valid(*it)) - return false; - - return true; -} - bool ircd::db::operator!=(const column::const_iterator_base &a, const column::const_iterator_base &b) noexcept @@ -5316,7 +5300,6 @@ namespace ircd::db } /// Convert our options structure into RocksDB's options structure. -[[gnu::hot]] rocksdb::ReadOptions ircd::db::make_opts(const gopts &opts) noexcept