MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / arrayindex

Function arrayindex

libraries/AP_Scripting/lua/src/ltable.c:151–158  ·  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

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

Callers 2

findindexFunction · 0.85
countintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected