From ae65ffdcbe28487ba48c9d4e0618f4d49ccb7303 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 4 Aug 2020 18:02:06 -0700 Subject: [PATCH] ircd::json::tuple: Use constexpr conditional in indexof() template. --- include/ircd/json/tuple/indexof.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/ircd/json/tuple/indexof.h b/include/ircd/json/tuple/indexof.h index 658d700a3..9532cce1d 100644 --- a/include/ircd/json/tuple/indexof.h +++ b/include/ircd/json/tuple/indexof.h @@ -31,12 +31,10 @@ constexpr typename std::enable_if(), size_t>::type indexof() noexcept { - constexpr auto equal - { - name_hash(key()) == hash - }; + if constexpr(name_hash(key()) == hash) + return i; - return equal? i : indexof(); + return indexof(); } template