From 288fcdaf531e43a951643eeab2e2cbf36138cfa0 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Sun, 19 May 2024 00:12:01 +0200 Subject: [PATCH] hashed_string: avoid magic numbers in return statements --- src/entt/core/hashed_string.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/entt/core/hashed_string.hpp b/src/entt/core/hashed_string.hpp index 6f100db2d..3c1e8ff63 100644 --- a/src/entt/core/hashed_string.hpp +++ b/src/entt/core/hashed_string.hpp @@ -13,17 +13,21 @@ namespace internal { [[nodiscard]] inline constexpr auto offset() noexcept { if constexpr(std::is_same_v) { - return 2166136261; + constexpr auto offset_value = 2166136261; + return offset_value; } else if constexpr(std::is_same_v) { - return 14695981039346656037ull; + constexpr auto offset_value = 14695981039346656037ull; + return offset_value; } } [[nodiscard]] inline constexpr auto prime() noexcept { if constexpr(std::is_same_v) { - return 16777619; + constexpr auto prime_value = 16777619; + return prime_value; } else if constexpr(std::is_same_v) { - return 1099511628211ull; + constexpr auto prime_value = 1099511628211ull; + return prime_value; } }