diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/digest/numeric.h | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/digest/numeric.h')
-rw-r--r-- | util/digest/numeric.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/digest/numeric.h b/util/digest/numeric.h index 59b60d1c2e..e20bd908e4 100644 --- a/util/digest/numeric.h +++ b/util/digest/numeric.h @@ -8,7 +8,7 @@ * copy: https://gist.github.com/badboy/6267743 */ -static constexpr ui8 IntHashImpl(ui8 key8) noexcept { +static constexpr ui8 IntHashImpl(ui8 key8) noexcept { size_t key = key8; key += ~(key << 15); @@ -21,7 +21,7 @@ static constexpr ui8 IntHashImpl(ui8 key8) noexcept { return static_cast<ui8>(key); } -static constexpr ui16 IntHashImpl(ui16 key16) noexcept { +static constexpr ui16 IntHashImpl(ui16 key16) noexcept { size_t key = key16; key += ~(key << 15); @@ -34,7 +34,7 @@ static constexpr ui16 IntHashImpl(ui16 key16) noexcept { return static_cast<ui16>(key); } -static constexpr ui32 IntHashImpl(ui32 key) noexcept { +static constexpr ui32 IntHashImpl(ui32 key) noexcept { key += ~(key << 15); key ^= (key >> 10); key += (key << 3); @@ -45,7 +45,7 @@ static constexpr ui32 IntHashImpl(ui32 key) noexcept { return key; } -static constexpr ui64 IntHashImpl(ui64 key) noexcept { +static constexpr ui64 IntHashImpl(ui64 key) noexcept { key += ~(key << 32); key ^= (key >> 22); key += ~(key << 13); @@ -59,8 +59,8 @@ static constexpr ui64 IntHashImpl(ui64 key) noexcept { } template <class T> -static constexpr T IntHash(T t) noexcept { - using TCvt = TFixedWidthUnsignedInt<T>; +static constexpr T IntHash(T t) noexcept { + using TCvt = TFixedWidthUnsignedInt<T>; return IntHashImpl((TCvt)(t)); } @@ -69,8 +69,8 @@ static constexpr T IntHash(T t) noexcept { * can handle floats && pointers */ template <class T> -static constexpr size_t NumericHash(T t) noexcept { - using TCvt = TFixedWidthUnsignedInt<T>; +static constexpr size_t NumericHash(T t) noexcept { + using TCvt = TFixedWidthUnsignedInt<T>; union Y_HIDDEN { T t; @@ -81,6 +81,6 @@ static constexpr size_t NumericHash(T t) noexcept { } template <class T> -static constexpr T CombineHashes(T l, T r) noexcept { +static constexpr T CombineHashes(T l, T r) noexcept { return IntHash(l) ^ r; } |