|
39 | 39 |
|
40 | 40 | #include <folly/Portability.h> |
41 | 41 | #include <folly/hash/SpookyHashV2.h> |
| 42 | +#include <folly/hash/rapidhash.h> |
42 | 43 | #include <folly/lang/CString.h> |
43 | 44 | #include <folly/lang/Exception.h> |
44 | 45 | #include <folly/portability/Constexpr.h> |
@@ -794,7 +795,7 @@ class Range { |
794 | 795 | } |
795 | 796 |
|
796 | 797 | // Do NOT use this function, which was left behind for backwards |
797 | | - // compatibility. Use SpookyHashV2 instead -- it is faster, and produces |
| 798 | + // compatibility. Use rapidhashNano instead -- it is faster, and produces |
798 | 799 | // a 64-bit hash, which means dramatically fewer collisions in large maps. |
799 | 800 | // (The above advice does not apply if you are targeting a 32-bit system.) |
800 | 801 | // |
@@ -1697,8 +1698,8 @@ struct hasher< |
1697 | 1698 | // can contain pointers and padding. Also, floating point numbers |
1698 | 1699 | // may be == without being bit-identical. size_t is less than 64 |
1699 | 1700 | // bits on some platforms. |
1700 | | - return static_cast<size_t>( |
1701 | | - hash::SpookyHashV2::Hash64(r.begin(), r.size() * sizeof(T), 0)); |
| 1701 | + return static_cast<size_t>(folly::hash::rapidhashNano( |
| 1702 | + reinterpret_cast<const char*>(r.begin()), r.size() * sizeof(T))); |
1702 | 1703 | } |
1703 | 1704 | }; |
1704 | 1705 |
|
|
0 commit comments