From 925be1160388386f962311a781c35d51d15e9753 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Wed, 8 Mar 2023 18:06:56 +0100 Subject: [PATCH] aa --- text_rendering/font.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/text_rendering/font.c b/text_rendering/font.c index e3ce29d..076452b 100644 --- a/text_rendering/font.c +++ b/text_rendering/font.c @@ -12,13 +12,12 @@ #include "util.h" // generic cache type -static unsigned int hash(unsigned int code) +#include "generic_cache.h" +static inline unsigned int hash(unsigned int code) { // identity map the ascii range - if (code < 128) return code; - return (uint32_t)((uint64_t)(code*2654435761)>>32); + return code < 128 ? code : hash_u32(code); } -#include "generic_cache.h" CACHE_DECL(cache, struct font_glyph, hash, hash_cmp_u32)