MCPcopy Create free account
hub / github.com/defold/defold / hashnum

Function hashnum

engine/lua/src/lua/ltable.c:84–92  ·  view source on GitHub ↗

** hash for lua_Numbers */

Source from the content-addressed store, hash-verified

82** hash for lua_Numbers
83*/
84static Node *hashnum (const Table *t, lua_Number n) {
85 unsigned int a[numints];
86 int i;
87 if (luai_numeq(n, 0)) /* avoid problems with -0 */
88 return gnode(t, 0);
89 memcpy(a, &n, sizeof(a));
90 for (i = 1; i < numints; i++) a[0] += a[i];
91 return hashmod(t, a[0]);
92}
93
94
95

Callers 2

mainpositionFunction · 0.85
luaH_getnumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected