From 99070a734a08fc1cbcee604d19a15b89fa6816d5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 3 Aug 2022 13:19:33 -0600 Subject: [PATCH] [cache] Use short instead of int if fits --- src/hb-cache.hh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/hb-cache.hh b/src/hb-cache.hh index e29984d93..c87fe91af 100644 --- a/src/hb-cache.hh +++ b/src/hb-cache.hh @@ -38,11 +38,15 @@ template struct hb_cache_t { - using item_t = typename std::conditional::type; + using item_t = typename std::conditional::type + >::type; static_assert ((key_bits >= cache_bits), ""); static_assert ((key_bits + value_bits - cache_bits <= 8 * sizeof (item_t)), ""); - static_assert (sizeof (item_t) == sizeof (unsigned int), ""); void init () { clear (); } void fini () {} @@ -78,7 +82,6 @@ struct hb_cache_t item_t values[1u< using hb_cmap_cache_t = hb_cache_t<21, 16, 8, thread_safe>;