MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / arrayindex

Function arrayindex

Source/Misc/lua/src/lua.c:9360–9369  ·  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

9358** the array part of the table, -1 otherwise.
9359*/
9360static int arrayindex (const TValue *key) {
9361if (ttisnumber(key)) {
9362lua_Number n = nvalue(key);
9363int k;
9364lua_number2int(k, n);
9365if (luai_numeq(cast_num(k), n))
9366return k;
9367}
9368return -1; /* `key' did not match some condition */
9369}
9370
9371
9372/*

Callers 2

findindexFunction · 0.85
countintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected