mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 23:14:13 +01:00
ircd::db: Inline some trivial default comparators.
This commit is contained in:
parent
aa2b902570
commit
2e1fc0c234
2 changed files with 14 additions and 27 deletions
|
@ -46,8 +46,15 @@ struct ircd::db::comparator
|
|||
struct ircd::db::cmp_string_view
|
||||
:db::comparator
|
||||
{
|
||||
static bool less(const string_view &a, const string_view &b) noexcept;
|
||||
static bool equal(const string_view &a, const string_view &b) noexcept;
|
||||
static bool less(const string_view &a, const string_view &b) noexcept
|
||||
{
|
||||
return a < b;
|
||||
}
|
||||
|
||||
static bool equal(const string_view &a, const string_view &b) noexcept
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
|
||||
cmp_string_view();
|
||||
};
|
||||
|
@ -56,7 +63,11 @@ struct ircd::db::reverse_cmp_string_view
|
|||
:db::comparator
|
||||
{
|
||||
static bool less(const string_view &a, const string_view &b) noexcept;
|
||||
static bool equal(const string_view &a, const string_view &b) noexcept;
|
||||
|
||||
static bool equal(const string_view &a, const string_view &b) noexcept
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
|
||||
reverse_cmp_string_view();
|
||||
};
|
||||
|
|
24
ircd/db.cc
24
ircd/db.cc
|
@ -7733,22 +7733,6 @@ ircd::db::cmp_string_view::cmp_string_view()
|
|||
{
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::db::cmp_string_view::less(const string_view &a,
|
||||
const string_view &b)
|
||||
noexcept
|
||||
{
|
||||
return a < b;
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::db::cmp_string_view::equal(const string_view &a,
|
||||
const string_view &b)
|
||||
noexcept
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
|
||||
//
|
||||
// reverse_cmp_string_view
|
||||
//
|
||||
|
@ -7775,14 +7759,6 @@ noexcept
|
|||
return std::memcmp(a.data(), b.data(), std::min(a.size(), b.size())) > 0;
|
||||
}
|
||||
|
||||
bool
|
||||
ircd::db::reverse_cmp_string_view::equal(const string_view &a,
|
||||
const string_view &b)
|
||||
noexcept
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// delta.h
|
||||
|
|
Loading…
Reference in a new issue