MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / reinsert

Function reinsert

3rd/lua-5.4.3/src/ltable.c:497–510  ·  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

495** (Re)insert all elements from the hash part of 'ot' into table 't'.
496*/
497static void reinsert (lua_State *L, Table *ot, Table *t) {
498 int j;
499 int size = sizenode(ot);
500 for (j = 0; j < size; j++) {
501 Node *old = gnode(ot, j);
502 if (!isempty(gval(old))) {
503 /* doesn't need barrier/invalidate cache, as entry was
504 already present in the table */
505 TValue k;
506 getnodekey(L, &k, old);
507 luaH_set(L, t, &k, gval(old));
508 }
509 }
510}
511
512
513/*

Callers 1

luaH_resizeFunction · 0.85

Calls 1

luaH_setFunction · 0.85

Tested by

no test coverage detected