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.
This commit is contained in:
rakshasa
2024-08-31 12:14:50 +00:00
parent eacf9798e2
commit 4e246a401f
+1 -4
View File
@@ -159,10 +159,7 @@ make_base(_InputIter __first, _InputIter __last, _Ftor __ftor) {
template<typename T>
inline int popcount_wrapper(T t) {
#if USE_BUILTIN_POPCOUNT
if (std::numeric_limits<T>::digits <= std::numeric_limits<unsigned int>::digits)
return __builtin_popcount(t);
else
return __builtin_popcountll(t);
return __builtin_popcountll(t);
#else
#error __builtin_popcount not found.
unsigned int count = 0;