** returns the index for 'key' if 'key' is an appropriate key to live in ** the array part of the table, 0 otherwise. */
| 142 | ** the array part of the table, 0 otherwise. |
| 143 | */ |
| 144 | static unsigned int arrayindex (const TValue *key) { |
| 145 | if (ttisinteger(key)) { |
| 146 | lua_Integer k = ivalue(key); |
| 147 | if (0 < k && (lua_Unsigned)k <= MAXASIZE) |
| 148 | return cast(unsigned int, k); /* 'key' is an appropriate array index */ |
| 149 | } |
| 150 | return 0; /* 'key' did not match some condition */ |
| 151 | } |
| 152 | |
| 153 | |
| 154 | /* |