MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / reinsert

Function reinsert

xrepo/packages/l/lua/port/lua/src/ltable.c:506–519  ·  view source on GitHub ↗

** (Re)insert all elements from the hash part of 'ot' into table 't'. */

Source from the content-addressed store, hash-verified

504** (Re)insert all elements from the hash part of 'ot' into table 't'.
505*/
506static void reinsert (lua_State *L, Table *ot, Table *t) {
507 int j;
508 int size = sizenode(ot);
509 for (j = 0; j < size; j++) {
510 Node *old = gnode(ot, j);
511 if (!isempty(gval(old))) {
512 /* doesn't need barrier/invalidate cache, as entry was
513 already present in the table */
514 TValue k;
515 getnodekey(L, &k, old);
516 luaH_set(L, t, &k, gval(old));
517 }
518 }
519}
520
521
522/*

Callers 1

luaH_resizeFunction · 0.85

Calls 1

luaH_setFunction · 0.70

Tested by

no test coverage detected