| 295 | } |
| 296 | |
| 297 | static inline int64_t SlowCountBits(const uint8_t* data, int64_t bit_offset, |
| 298 | int64_t length) { |
| 299 | int64_t count = 0; |
| 300 | for (int64_t i = bit_offset; i < bit_offset + length; ++i) { |
| 301 | if (bit_util::GetBit(data, i)) { |
| 302 | ++count; |
| 303 | } |
| 304 | } |
| 305 | return count; |
| 306 | } |
| 307 | |
| 308 | TEST(BitUtilTests, TestCountSetBits) { |
| 309 | const int kBufferSize = 1000; |