| 283 | |
| 284 | |
| 285 | static int numusehash (const Table *t, unsigned int *nums, unsigned int *pna) { |
| 286 | int totaluse = 0; /* total number of elements */ |
| 287 | int ause = 0; /* elements added to 'nums' (can go to array part) */ |
| 288 | int i = sizenode(t); |
| 289 | while (i--) { |
| 290 | Node *n = &t->node[i]; |
| 291 | if (!ttisnil(gval(n))) { |
| 292 | ause += countint(gkey(n), nums); |
| 293 | totaluse++; |
| 294 | } |
| 295 | } |
| 296 | *pna += ause; |
| 297 | return totaluse; |
| 298 | } |
| 299 | |
| 300 | |
| 301 | static void setarrayvector (lua_State *L, Table *t, unsigned int size) { |