Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
We can simplify the logical bit operations in util/bit_block_counter.h so that the specializations for bool and T can be merged because C++ guarantees that for boolean types: (bool)(a & b) == a && b. Note the explicit cast which corresponds to the return type T in these functions.
// Works correctly for bool and integer types template <typename T> T bit_and(T x, T y) { return x & y; }
This change has a higher impact for ternary bitwise versions, see for example here
Attachments
Issue Links
- links to