MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / arrayindex

Function arrayindex

lib/lua/src/ltable.c:318–323  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

316** the array part of a table, 0 otherwise.
317*/
318static unsigned int arrayindex (lua_Integer k) {
319 if (l_castS2U(k) - 1u < MAXASIZE) /* 'k' in [1, MAXASIZE]? */
320 return cast_uint(k); /* 'key' is an appropriate array index */
321 else
322 return 0;
323}
324
325
326/*

Callers 2

findindexFunction · 0.85
countintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected