0
0
Fork 0
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:
Jason Volk 2020-07-28 01:22:02 -07:00
parent aa2b902570
commit 2e1fc0c234
2 changed files with 14 additions and 27 deletions

View file

@ -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();
};

View file

@ -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