MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / numusehash

Function numusehash

lua/ltable.c:281–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279
280
281static int numusehash (const Table *t, int *nums, int *pnasize) {
282 int totaluse = 0; /* total number of elements */
283 int ause = 0; /* summation of `nums' */
284 int i = sizenode(t);
285 while (i--) {
286 Node *n = &t->node[i];
287 if (!ttisnil(gval(n))) {
288 ause += countint(key2tval(n), nums);
289 totaluse++;
290 }
291 }
292 *pnasize += ause;
293 return totaluse;
294}
295
296
297static void setarrayvector (lua_State *L, Table *t, int size) {

Callers 1

rehashFunction · 0.85

Calls 1

countintFunction · 0.85

Tested by

no test coverage detected