From 82d4f21a4b56c83158e50bdb6fdaaf0bd36bc2d5 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Wed, 15 Jan 2025 00:11:47 +0300 Subject: [PATCH] twn_textures.c: minor optimization --- src/twn_textures.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twn_textures.c b/src/twn_textures.c index 9be9ca4..9c61041 100644 --- a/src/twn_textures.c +++ b/src/twn_textures.c @@ -404,7 +404,7 @@ static TextureKey textures_load(TextureCache *cache, const char *path) { shput(cache->hash, path, new_texture); - uint16_t const id = (uint16_t)shgeti(cache->hash, path); + uint16_t const id = (uint16_t)shlenu(cache->hash) - 1; /* reuse this id for every later missing texture */ if (surface == missing_texture_surface)