From fa3438a40ad61bbed14f826ac6dd635d711fa6f3 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Sun, 16 Mar 2025 16:59:38 +0100 Subject: [PATCH] refactor(cyclic_hash): use `auto` for `static_cast` result --- include/dwarfs/writer/internal/cyclic_hash.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/dwarfs/writer/internal/cyclic_hash.h b/include/dwarfs/writer/internal/cyclic_hash.h index 23573818..9ab16e92 100644 --- a/include/dwarfs/writer/internal/cyclic_hash.h +++ b/include/dwarfs/writer/internal/cyclic_hash.h @@ -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(byte); - uint16_t a{static_cast(v * length)}; - uint16_t b{static_cast(v * (length * (length + 1)) / 2)}; + auto v = static_cast(byte); + auto a = static_cast(v * length); + auto b = static_cast(v * (length * (length + 1)) / 2); return static_cast(a) | (static_cast(b) << 16); }