** returns the index for `key' if `key' is an appropriate key to live in ** the array part of the table, -1 otherwise. */
| 9358 | ** the array part of the table, -1 otherwise. |
| 9359 | */ |
| 9360 | static int arrayindex (const TValue *key) { |
| 9361 | if (ttisnumber(key)) { |
| 9362 | lua_Number n = nvalue(key); |
| 9363 | int k; |
| 9364 | lua_number2int(k, n); |
| 9365 | if (luai_numeq(cast_num(k), n)) |
| 9366 | return k; |
| 9367 | } |
| 9368 | return -1; /* `key' did not match some condition */ |
| 9369 | } |
| 9370 | |
| 9371 | |
| 9372 | /* |