From: Joel Rosdahl Date: Wed, 29 Jul 2020 16:51:59 +0000 (+0200) Subject: Remove superfluous hash_from_int function X-Git-Tag: v4.0~262 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9a699f9d94d0ef640bf2fc17b791b9498292189;p=thirdparty%2Fccache.git Remove superfluous hash_from_int function --- diff --git a/src/Context.cpp b/src/Context.cpp index 5ee6367d5..c2f25d754 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -75,8 +75,8 @@ Context::stats_file() const // An empty m_result_stats_file means that set_result_name hasn't been // called yet, so we just choose one of stats files in the 16 // subdirectories. - m_result_stats_file = fmt::format( - "{}/{:x}/stats", config.cache_dir(), hash_from_int(getpid()) % 16); + m_result_stats_file = + fmt::format("{}/{:x}/stats", config.cache_dir(), getpid() % 16); } return m_result_stats_file; } diff --git a/src/hashutil.cpp b/src/hashutil.cpp index 56dede7f0..fdf00cfd6 100644 --- a/src/hashutil.cpp +++ b/src/hashutil.cpp @@ -58,11 +58,6 @@ # include #endif -unsigned -hash_from_int(int i) -{ - return XXH64(&i, sizeof(int), 0); -} // Returns one of HASH_SOURCE_CODE_FOUND_DATE, HASH_SOURCE_CODE_FOUND_TIME or // HASH_SOURCE_CODE_FOUND_TIMESTAMP if "_DATE__", "_TIME__" or "_TIMESTAMP__" diff --git a/src/hashutil.hpp b/src/hashutil.hpp index 5b4acd5ec..bb10d8796 100644 --- a/src/hashutil.hpp +++ b/src/hashutil.hpp @@ -26,8 +26,6 @@ class Config; class Context; class Hash; -unsigned hash_from_int(int i); - #define HASH_SOURCE_CODE_OK 0 #define HASH_SOURCE_CODE_ERROR 1 #define HASH_SOURCE_CODE_FOUND_DATE 2