In rehashtab, do counthash before adding asize

Thanks alug!
This commit is contained in:
Alug committed 2025-01-29 22:28:44 +01:00
1 parent 3162930634
commit 3cc8f8650d
1 file changed
+3 -1
+3 -1
View File
@@ -363,7 +363,9 @@ static void rehashtab(lua_State *L, GCtab *t, cTValue *ek)
total = 1 + asize;
total += counthash(t, bins, &asize);
#else
total = 1 + asize + counthash(t, bins, &asize);
/* more closely matches vanilla lua when abusing undefined behavior (frictionfix.....) */
total = counthash(t, bins, &asize);
total += 1 + asize;
#endif
asize += countint(ek, bins);
na = bestasize(bins, &asize);