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 ef711fd commit 6cafba1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions libtorrent/src/torrent/bitfield.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Bitfield::update() {

while (itr + sizeof(unsigned int) <= last) {
#if USE_AVX2_POPCOUNT
m_set += rak::popcount_wrapper_avx2(reinterpret_cast<uint8_t*>(itr));
#else
m_set += rak::popcount_wrapper(*reinterpret_cast<unsigned int*>(itr));
#endif
Expand All @@ -103,15 +104,11 @@ Bitfield::update() {

while (itr != last) {
#if USE_AVX2_POPCOUNT
itr++;
m_set += rak::popcount_wrapper_avx2(reinterpret_cast<uint8_t*>(itr++));
#else
m_set += rak::popcount_wrapper(*itr++);
#endif
}

#if USE_AVX2_POPCOUNT
m_set = rak::popcount_wrapper_avx2(reinterpret_cast<uint8_t*>(itr));
#endif
}

void
Expand Down

0 comments on commit 6cafba1

Please sign in to comment.