MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / arrayindex

Function arrayindex

third-party/lua-5.2.4/src/ltable.c:127–136  ·  view source on GitHub ↗

** returns the index for `key' if `key' is an appropriate key to live in ** the array part of the table, -1 otherwise. */

Source from the content-addressed store, hash-verified

125** the array part of the table, -1 otherwise.
126*/
127static int arrayindex (const TValue *key) {
128 if (ttisnumber(key)) {
129 lua_Number n = nvalue(key);
130 int k;
131 lua_number2int(k, n);
132 if (luai_numeq(cast_num(k), n))
133 return k;
134 }
135 return -1; /* `key' did not match some condition */
136}
137
138
139/*

Callers 2

findindexFunction · 0.70
countintFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected