ircd::db: Shorter paths to valid(iterator); strip noexcept; hot annotate uninlineable.
This commit is contained in:
parent
6e6afb9d30
commit
23c8a6c5cb
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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<bool>(*this);
|
||||
}
|
||||
|
||||
inline ircd::db::column::const_iterator_base::operator
|
||||
bool()
|
||||
const
|
||||
{
|
||||
return it && valid(*it);
|
||||
}
|
||||
|
||||
inline ircd::db::column::const_iterator_base::operator
|
||||
gopts &()
|
||||
{
|
||||
|
|
23
ircd/db.cc
23
ircd/db.cc
|
@ -2146,7 +2146,9 @@ template bool ircd::db::seek<ircd::db::pos>(cell &, const pos &, gopts);
|
|||
template bool ircd::db::seek<ircd::string_view>(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
|
||||
|
|
Loading…
Reference in New Issue