aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-06-28 13:15:44 +0300
committerthegeorg <thegeorg@yandex-team.ru>2022-06-28 13:15:44 +0300
commitb13fbd750496fa994449f37c8c8a49bed18ccd6e (patch)
treec71de4a67b2cd527edae044d902d5ffdcce5473e
parent7a8efeb2c9c204feb9cc44b987708e97f05a8aec (diff)
downloadydb-b13fbd750496fa994449f37c8c8a49bed18ccd6e.tar.gz
util: Drop NO_CITYHASH point of customisation
ref:613556c5a389af24a29e4fdef6ec5dfeee33bd39
-rw-r--r--util/digest/city.cpp16
-rw-r--r--util/generic/string_hash.h4
2 files changed, 8 insertions, 12 deletions
diff --git a/util/digest/city.cpp b/util/digest/city.cpp
index a1436a47e0..c0c7c1a2e9 100644
--- a/util/digest/city.cpp
+++ b/util/digest/city.cpp
@@ -1,5 +1,3 @@
-#ifndef NO_CITYHASH
-
// Copyright (c) 2011 Google, Inc.
// Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -29,24 +27,24 @@
// possible hash functions, by using SIMD instructions, or by
// compromising on hash quality.
- #include "city.h"
+#include "city.h"
using uint8 = ui8;
using uint32 = ui32;
using uint64 = ui64;
- #include <util/system/unaligned_mem.h>
- #include <util/generic/algorithm.h>
+#include <util/system/unaligned_mem.h>
+#include <util/generic/algorithm.h>
using namespace std;
//#define UNALIGNED_LOAD64(p) (*(const uint64*)(p))
//#define UNALIGNED_LOAD32(p) (*(const uint32*)(p))
- #define UNALIGNED_LOAD64(p) (ReadUnaligned<uint64>((const void*)(p)))
- #define UNALIGNED_LOAD32(p) (ReadUnaligned<uint32>((const void*)(p)))
+#define UNALIGNED_LOAD64(p) (ReadUnaligned<uint64>((const void*)(p)))
+#define UNALIGNED_LOAD32(p) (ReadUnaligned<uint32>((const void*)(p)))
- #define LIKELY(x) Y_LIKELY(!!(x))
+#define LIKELY(x) Y_LIKELY(!!(x))
// Some primes between 2^63 and 2^64 for various uses.
static const uint64 k0 = 0xc3a5c85c97cb3127ULL;
@@ -309,5 +307,3 @@ uint128 CityHash128(const char* s, size_t len) noexcept {
return CityHash128WithSeed(s, len, uint128(k0, k1));
}
}
-
-#endif
diff --git a/util/generic/string_hash.h b/util/generic/string_hash.h
index b873f23b11..54eaaf942a 100644
--- a/util/generic/string_hash.h
+++ b/util/generic/string_hash.h
@@ -3,7 +3,7 @@
#include <cstddef>
// reduce code bloat and cycled includes, declare functions here
-#if defined(_64_) && !defined(NO_CITYHASH)
+#if defined(_64_)
ui64 CityHash64(const char* buf, size_t len) noexcept;
#else
template <typename T>
@@ -13,7 +13,7 @@ T MurmurHash(const void* buf, size_t len) noexcept;
namespace NHashPrivate {
template <typename C>
size_t ComputeStringHash(const C* ptr, size_t size) noexcept {
-#if defined(_64_) && !defined(NO_CITYHASH)
+#if defined(_64_)
return CityHash64((const char*)ptr, size * sizeof(C));
#else
return MurmurHash<size_t>(ptr, size * sizeof(C));