From 9f0b0a184770aced2572ef2dff6d7079b6d41e49 Mon Sep 17 00:00:00 2001 From: stickz Date: Thu, 4 Jul 2024 20:18:08 -0400 Subject: [PATCH] Fixes --- libtorrent/src/torrent/bitfield.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libtorrent/src/torrent/bitfield.cc b/libtorrent/src/torrent/bitfield.cc index 67bff271..0d69fc74 100644 --- a/libtorrent/src/torrent/bitfield.cc +++ b/libtorrent/src/torrent/bitfield.cc @@ -88,23 +88,23 @@ Bitfield::update() { // Clears the unused bits. clear_tail(); - #if USE_AVX2_POPCOUNT - m_set = rak::popcount_wrapper_avx2(m_data); - #else m_set = 0; iterator itr = m_data; iterator last = end(); while (itr + sizeof(unsigned int) <= last) { + #if USE_AVX2_POPCOUNT + m_set += rak::popcount_wrapper_avx2(itr); + #else m_set += rak::popcount_wrapper(*reinterpret_cast(itr)); + #endif itr += sizeof(unsigned int); } while (itr != last) { m_set += rak::popcount_wrapper(*itr++); } - #endif } void