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

Function reinsertOldSlice

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

** Re-insert into the new hash part of a table the elements from the ** vanishing slice of the array part. */

Source from the content-addressed store, hash-verified

674** vanishing slice of the array part.
675*/
676static void reinsertOldSlice (Table *t, unsigned oldasize,
677 unsigned newasize) {
678 unsigned i;
679 for (i = newasize; i < oldasize; i++) { /* traverse vanishing slice */
680 lu_byte tag = *getArrTag(t, i);
681 if (!tagisempty(tag)) { /* a non-empty entry? */
682 TValue key, aux;
683 setivalue(&key, l_castU2S(i) + 1); /* make the key */
684 farr2val(t, i, tag, &aux); /* copy value into 'aux' */
685 insertkey(t, &key, &aux); /* insert entry into the hash part */
686 }
687 }
688}
689
690
691/*

Callers 1

luaH_resizeFunction · 0.85

Calls 1

insertkeyFunction · 0.85

Tested by

no test coverage detected