From fc80d20cb5cd25ee2d2579f2da018870e76aaa0e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 23 Jun 2023 15:21:30 -0600 Subject: [PATCH] [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. --- src/hb-serialize.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index 3e2d6a0d9..f852f07ba 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -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 (); }