mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 09:28:21 +00:00
Simplify remove_trailing_zeros
This commit is contained in:
parent
9b23e9dcb8
commit
c8bd1e646e
@ -1843,12 +1843,9 @@ FMT_INLINE int remove_trailing_zeros(uint32_t& n) noexcept {
|
||||
int s = 0;
|
||||
while (true) {
|
||||
auto q = rotr(n * mod_inv_25, 2);
|
||||
if (q <= std::numeric_limits<uint32_t>::max() / 100) {
|
||||
n = q;
|
||||
s += 2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if (q > std::numeric_limits<uint32_t>::max() / 100) break;
|
||||
n = q;
|
||||
s += 2;
|
||||
}
|
||||
auto q = rotr(n * mod_inv_5, 1);
|
||||
if (q <= std::numeric_limits<uint32_t>::max() / 10) {
|
||||
|
Loading…
Reference in New Issue
Block a user