From 4e246a401f2572d6c8a3295cbe0335baa316cd24 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Sat, 31 Aug 2024 12:14:50 +0000 Subject: [PATCH] Remove decision structure for popcount_wrapper The decision structure is very costly. It's significantly faster to work with long long than to use it. --- rak/algorithm.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rak/algorithm.h b/rak/algorithm.h index 98613820..2eace265 100644 --- a/rak/algorithm.h +++ b/rak/algorithm.h @@ -159,10 +159,7 @@ make_base(_InputIter __first, _InputIter __last, _Ftor __ftor) { template inline int popcount_wrapper(T t) { #if USE_BUILTIN_POPCOUNT - if (std::numeric_limits::digits <= std::numeric_limits::digits) - return __builtin_popcount(t); - else - return __builtin_popcountll(t); + return __builtin_popcountll(t); #else #error __builtin_popcount not found. unsigned int count = 0;