refactor(cyclic_hash): use auto for static_cast result

This commit is contained in:
Marcus Holland-Moritz 2025-03-16 16:59:38 +01:00
parent 95dc0fea3b
commit fa3438a40a

View File

@ -56,9 +56,9 @@ class rsync_hash {
static DWARFS_FORCE_INLINE constexpr uint32_t
repeating_window(uint8_t byte, size_t length) {
uint16_t v = static_cast<uint16_t>(byte);
uint16_t a{static_cast<uint16_t>(v * length)};
uint16_t b{static_cast<uint16_t>(v * (length * (length + 1)) / 2)};
auto v = static_cast<uint16_t>(byte);
auto a = static_cast<uint16_t>(v * length);
auto b = static_cast<uint16_t>(v * (length * (length + 1)) / 2);
return static_cast<uint32_t>(a) | (static_cast<uint32_t>(b) << 16);
}