MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / hashint

Function hashint

xrepo/packages/l/lua/port/lua/src/ltable.c:108–114  ·  view source on GitHub ↗

** Hash for integers. To allow a good hash, use the remainder operator ** ('%'). If integer fits as a non-negative int, compute an int ** remainder, which is faster. Otherwise, use an unsigned-integer ** remainder, which uses all bits and ensures a non-negative result. */

Source from the content-addressed store, hash-verified

106** remainder, which uses all bits and ensures a non-negative result.
107*/
108static Node *hashint (const Table *t, lua_Integer i) {
109 lua_Unsigned ui = l_castS2U(i);
110 if (ui <= (unsigned int)INT_MAX)
111 return hashmod(t, cast_int(ui));
112 else
113 return hashmod(t, ui);
114}
115
116
117/*

Callers 2

mainpositionTVFunction · 0.85
luaH_getintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected