0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-01 08:18:20 +02:00

ircd::json::tuple: Use constexpr conditional in indexof() template.

This commit is contained in:
Jason Volk 2020-08-04 18:02:06 -07:00
parent 541997ab9d
commit ae65ffdcbe

View file

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