mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 19:22:29 +00:00
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:
+1
-4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user