mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-27 21:00:01 +01:00
Remove std:: infront of uint32_t/64_t & add constexpr to rotr
This commit is contained in:
committed by
Victor Zverovich
parent
9b62310f03
commit
69f2c550ab
@@ -818,11 +818,11 @@ struct uint128_wrapper {
|
||||
};
|
||||
|
||||
// Compilers should be able to optimize this into the ror instruction.
|
||||
inline std::uint32_t rotr(uint32_t n, uint32_t r) noexcept {
|
||||
inline constexpr uint32_t rotr(uint32_t n, uint32_t r) noexcept {
|
||||
r &= 31;
|
||||
return (n >> r) | (n << (32 - r));
|
||||
}
|
||||
inline std::uint64_t rotr(uint64_t n, uint32_t r) noexcept {
|
||||
inline constexpr uint64_t rotr(uint64_t n, uint32_t r) noexcept {
|
||||
r &= 63;
|
||||
return (n >> r) | (n << (64 - r));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user