MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / arrayindex

Function arrayindex

lua/ltable.c:154–163  ·  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

152** the array part of the table, -1 otherwise.
153*/
154static int arrayindex (const TValue *key) {
155 if (ttisnumber(key)) {
156 lua_Number n = nvalue(key);
157 int k;
158 lua_number2int(k, n);
159 if (luai_numeq(cast_num(k), n))
160 return k;
161 }
162 return -1; /* `key' did not match some condition */
163}
164
165
166/*

Callers 2

findindexFunction · 0.85
countintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected