** returns the index for 'key' if 'key' is an appropriate key to live in ** the array part of the table, 0 otherwise. */
| 149 | ** the array part of the table, 0 otherwise. |
| 150 | */ |
| 151 | static 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 | /* |