Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stickz committed Jul 5, 2024
1 parent 15f3a7e commit 9f0b0a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libtorrent/src/torrent/bitfield.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int*>(itr));
#endif
itr += sizeof(unsigned int);
}

while (itr != last) {
m_set += rak::popcount_wrapper(*itr++);
}
#endif
}

void
Expand Down

0 comments on commit 9f0b0a1

Please sign in to comment.