[serialize] Only hash at most 128 bytes for object_t

Optimization. Shouldn't in reality bring down the hash performance.
Byte objects differ in their early bytes anyway.
This commit is contained in:
Behdad Esfahbod 2023-06-23 15:21:30 -06:00
parent 19eb5e3b6c
commit fc80d20cb5

View file

@ -113,7 +113,7 @@ struct hb_serialize_context_t
{
// Virtual links aren't considered for equality since they don't affect the functionality
// of the object.
return hb_bytes_t (head, tail - head).hash () ^
return hb_bytes_t (head, hb_min (128, tail - head)).hash () ^
real_links.as_bytes ().hash ();
}