llvm-project
649cbcc3 - [libc++] Remove unnecessary division and modulo operations in bitset (#121312)

Commit
1 year ago
[libc++] Remove unnecessary division and modulo operations in bitset (#121312) The PR removes the unnecessary division and modulo operations in the one-word specialization `__bitset<1, _Size>`. The reason is that for the one-word specialization, we have `__pos < __bits_per_word` (as `__bitset<1, _Size>` is an implementation detail only used by the public `bitset`). So `__pos / __bits_per_word == 0` and `__pos / __pos % __bits_per_word == __pos`.
Author
Parents
Loading