MCPcopy Create free account
hub / github.com/DFHack/dfhack / numusehash

Function numusehash

depends/lua/src/ltable.c:285–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283
284
285static 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
301static void setarrayvector (lua_State *L, Table *t, unsigned int size) {

Callers 1

rehashFunction · 0.85

Calls 1

countintFunction · 0.85

Tested by

no test coverage detected