MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / arrayindex

Function arrayindex

3rd/lua-5.4.3/src/ltable.c:307–312  ·  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

305** the array part of a table, 0 otherwise.
306*/
307static unsigned int arrayindex (lua_Integer k) {
308 if (l_castS2U(k) - 1u < MAXASIZE) /* 'k' in [1, MAXASIZE]? */
309 return cast_uint(k); /* 'key' is an appropriate array index */
310 else
311 return 0;
312}
313
314
315/*

Callers 2

findindexFunction · 0.85
countintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected