MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / numusehash

Function numusehash

third-party/lua-5.5.0/src/ltable.c:521–537  ·  view source on GitHub ↗

** Count keys in hash part of table 't'. As this only happens during ** a rehash, all nodes have been used. A node can have a nil value only ** if it was deleted after being created. */

Source from the content-addressed store, hash-verified

519** if it was deleted after being created.
520*/
521static void numusehash (const Table *t, Counters *ct) {
522 unsigned i = sizenode(t);
523 unsigned total = 0;
524 while (i--) {
525 Node *n = &t->node[i];
526 if (isempty(gval(n))) {
527 lua_assert(!keyisnil(n)); /* entry was deleted; key cannot be nil */
528 ct->deleted = 1;
529 }
530 else {
531 total++;
532 if (keyisinteger(n))
533 countint(keyival(n), ct);
534 }
535 }
536 ct->total += total;
537}
538
539
540/*

Callers 1

rehashFunction · 0.70

Calls 1

countintFunction · 0.70

Tested by

no test coverage detected