ensure compute_seed_hash uses a common definition to avoid conflicting definitions
diff --git a/common/include/MurmurHash3.h b/common/include/MurmurHash3.h
index b438c7d..c1cbeab 100644
--- a/common/include/MurmurHash3.h
+++ b/common/include/MurmurHash3.h
@@ -3,6 +3,7 @@
// * Changed input seed in MurmurHash3_x64_128 to uint64_t
// * Define and use HashState reference to return result
// * Made entire hash function defined inline
+// * Added compute_seed_hash
//-----------------------------------------------------------------------------
// MurmurHash3 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
@@ -170,4 +171,10 @@
//-----------------------------------------------------------------------------
+FORCE_INLINE uint16_t compute_seed_hash(uint64_t seed) {
+ HashState hashes;
+ MurmurHash3_x64_128(&seed, sizeof(seed), 0, hashes);
+ return static_cast<uint16_t>(hashes.h1 & 0xffff);
+}
+
#endif // _MURMURHASH3_H_
diff --git a/cpc/include/cpc_util.hpp b/cpc/include/cpc_util.hpp
index b63f26f..1a33b3a 100644
--- a/cpc/include/cpc_util.hpp
+++ b/cpc/include/cpc_util.hpp
@@ -24,12 +24,6 @@
namespace datasketches {
-static inline uint16_t compute_seed_hash(uint64_t seed) {
- HashState hashes;
- MurmurHash3_x64_128(&seed, sizeof(seed), 0, hashes);
- return hashes.h1 & 0xffff;
-}
-
static inline uint64_t divide_longs_rounding_up(uint64_t x, uint64_t y) {
if (y == 0) throw std::invalid_argument("divide_longs_rounding_up: bad argument");
const uint64_t quotient = x / y;
diff --git a/theta/include/theta_update_sketch_base.hpp b/theta/include/theta_update_sketch_base.hpp
index 337f68f..eae7984 100644
--- a/theta/include/theta_update_sketch_base.hpp
+++ b/theta/include/theta_update_sketch_base.hpp
@@ -185,12 +185,6 @@
return (hashes.h1 >> 1); // Java implementation does unsigned shift >>> to make values positive
}
-static inline uint16_t compute_seed_hash(uint64_t seed) {
- HashState hashes;
- MurmurHash3_x64_128(&seed, sizeof(seed), 0, hashes);
- return hashes.h1;
-}
-
// iterators
template<typename Entry, typename ExtractKey>