| 32 | #define BLOOM_VERSION_MINOR 201 |
| 33 | |
| 34 | inline static int test_bit_set_bit(uint8_t *bf, uint64_t bit, int set_bit) |
| 35 | { |
| 36 | uint64_t byte = bit >> 3; |
| 37 | uint8_t c = bf[byte]; // expensive memory access |
| 38 | uint8_t mask = 1 << (bit % 8); |
| 39 | if (c & mask) { |
| 40 | return 1; |
| 41 | } else { |
| 42 | if (set_bit) { |
| 43 | bf[byte] = c | mask; |
| 44 | } |
| 45 | return 0; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | inline static int test_bit(uint8_t *bf, uint64_t bit) |
| 50 | { |