X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=hash.cpp;fp=hash.cpp;h=af56263ec5f71c71c161fd956572201eab6791e6;hb=cb27055548a580a20c65a58cc1e1760a41245314;hp=72ed743533520212e27bc4396292240f8bc343a8;hpb=8f777b504b52cb15a09666b164343ae43ca5bfb5;p=remoteglot-book diff --git a/hash.cpp b/hash.cpp index 72ed743..af56263 100644 --- a/hash.cpp +++ b/hash.cpp @@ -9,6 +9,6 @@ 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 = max(len, 10); + len = min(len, 10); return util::Fingerprint32(s, len) % num_buckets; }