| 417 | |
| 418 | |
| 419 | static int numusehash(const Table *t, unsigned int *nums, unsigned int *pna) { |
| 420 | int totaluse = 0; /* total number of elements */ |
| 421 | int ause = 0; /* elements added to 'nums' (can go to array part) */ |
| 422 | int i = sizenode(t); |
| 423 | while (i--) { |
| 424 | Node *n = &t->node[i]; |
| 425 | if (!ttisnil(gval(n))) { |
| 426 | ause += countint(gkey(n), nums); |
| 427 | totaluse++; |
| 428 | } |
| 429 | } |
| 430 | *pna += ause; |
| 431 | return totaluse; |
| 432 | } |
| 433 | |
| 434 | |
| 435 | static void setarrayvector(lua_State *L, Table *t, unsigned int size) { |