]> git.sesse.net Git - remoteglot-book/blobdiff - hash.cpp
Switch value format to protobuf. Slightly smaller, easier to deal with extensions...
[remoteglot-book] / hash.cpp
index af56263ec5f71c71c161fd956572201eab6791e6..cc15148cdd0d1f40a33add1d8ad398d18f7d7966 100644 (file)
--- a/hash.cpp
+++ b/hash.cpp
@@ -6,9 +6,6 @@ using namespace std;
 
 int hash_key_to_bucket(const char* s, size_t len, int num_buckets)
 {
-       // We hash only the first 10 bytes; it should be enough to get a
-       // reasonable spread, but also mostly miss the move, so that
-       // same position + different move usually land in the same bucket.
-       len = min<size_t>(len, 10);
+       len = min<size_t>(len, HASH_PREFIX_BYTES);
        return util::Fingerprint32(s, len) % num_buckets;
 }