diff --git a/libtorrent/src/torrent/bitfield.cc b/libtorrent/src/torrent/bitfield.cc index 25c7dc8c..df4be99c 100644 --- a/libtorrent/src/torrent/bitfield.cc +++ b/libtorrent/src/torrent/bitfield.cc @@ -95,6 +95,7 @@ Bitfield::update() { while (itr + sizeof(unsigned int) <= last) { #if USE_AVX2_POPCOUNT + m_set += rak::popcount_wrapper_avx2(reinterpret_cast(itr)); #else m_set += rak::popcount_wrapper(*reinterpret_cast(itr)); #endif @@ -103,15 +104,11 @@ Bitfield::update() { while (itr != last) { #if USE_AVX2_POPCOUNT - itr++; + m_set += rak::popcount_wrapper_avx2(reinterpret_cast(itr++)); #else m_set += rak::popcount_wrapper(*itr++); #endif } - - #if USE_AVX2_POPCOUNT - m_set = rak::popcount_wrapper_avx2(reinterpret_cast(itr)); - #endif } void