MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / arrayindex

Function arrayindex

xrepo/packages/l/lua/port/lua/src/ltable.c:316–321  ·  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

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

Callers 2

findindexFunction · 0.70
countintFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected