From d2c9a3e1b60174ba7ea925209e487098bbdf435e Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 11 Apr 2026 16:34:32 +0200 Subject: [PATCH] BLUA: simplify lua number hash --- src/blua/ltable.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/blua/ltable.c b/src/blua/ltable.c index 0ddd9ef4f..8105fc373 100644 --- a/src/blua/ltable.c +++ b/src/blua/ltable.c @@ -81,6 +81,7 @@ static /*const*/ Node dummynode_ = { /* ** hash for lua_Numbers */ +#if 0 static Node *hashnum (const Table *t, lua_Number n) { unsigned int a[numints]; int i; @@ -90,6 +91,12 @@ static Node *hashnum (const Table *t, lua_Number n) { for (i = 1; i < numints; i++) a[0] += a[i]; return hashmod(t, a[0]); } +#else +// our lua_Number is just typedef´d int32 so no need to do any of the above +static inline Node *hashnum (const Table *t, lua_Number n) { + return hashmod(t, cast(unsigned int, n)); +} +#endif