BLUA: simplify lua number hash

This commit is contained in:
Alug 2026-04-11 16:34:32 +02:00 committed by NepDisk
parent e59aad944c
commit d2c9a3e1b6

View file

@ -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