mirror of
https://github.com/matrix-construct/construct
synced 2025-02-19 18:20:19 +01:00
ircd::json::tuple: Use constexpr conditional in indexof() template.
This commit is contained in:
parent
541997ab9d
commit
ae65ffdcbe
1 changed files with 3 additions and 5 deletions
|
@ -31,12 +31,10 @@ constexpr typename std::enable_if<i < size<tuple>(), size_t>::type
|
|||
indexof()
|
||||
noexcept
|
||||
{
|
||||
constexpr auto equal
|
||||
{
|
||||
name_hash(key<tuple, i>()) == hash
|
||||
};
|
||||
if constexpr(name_hash(key<tuple, i>()) == hash)
|
||||
return i;
|
||||
|
||||
return equal? i : indexof<tuple, hash, i + 1>();
|
||||
return indexof<tuple, hash, i + 1>();
|
||||
}
|
||||
|
||||
template<class tuple,
|
||||
|
|
Loading…
Add table
Reference in a new issue