MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / arrayindex

Function arrayindex

src/Chain/libraries/glua/ltable.cpp:152–159  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

150** the array part of the table, 0 otherwise.
151*/
152static unsigned int arrayindex(const TValue *key) {
153 if (ttisinteger(key)) {
154 lua_Integer k = ivalue(key);
155 if (0 < k && (lua_Unsigned)k <= MAXASIZE)
156 return lua_cast(unsigned int, k); /* 'key' is an appropriate array index */
157 }
158 return 0; /* 'key' did not match some condition */
159}
160
161
162/*

Callers 3

findindexFunction · 0.85
countintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected