Skip to content

Commit

Permalink
Update COUNT_UNSET_BIT()
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Jul 3, 2022
1 parent 2439921 commit 0e2177d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Sieve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,11 @@ void Sieve::cross_off_count(uint64_t prime, uint64_t i)
#define COUNT_UNSET_BIT(bit_index) \
{ \
std::size_t sieve_byte = sieve[m]; \
std::size_t is_bit = (sieve_byte >> bit_index) & 1; \
sieve_byte &= ~(1 << bit_index); \
std::size_t bit = sieve_byte & (1 << bit_index); \
std::size_t is_bit = bit >> bit_index; \
sieve[m] = (uint8_t) (sieve_byte - bit); \
counter[m >> counter_log2_dist] -= (uint32_t) is_bit; \
total_count -= is_bit; \
sieve[m] = (uint8_t) sieve_byte; \
}

switch (wheel.index)
Expand Down

0 comments on commit 0e2177d

Please sign in to comment.