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

Function newcheckedkey

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

** Insert a key in a table where there is space for that key, the ** key is valid, and the value is not nil. */

Source from the content-addressed store, hash-verified

900** key is valid, and the value is not nil.
901*/
902static void newcheckedkey (Table *t, const TValue *key, TValue *value) {
903 unsigned i = keyinarray(t, key);
904 if (i > 0) /* is key in the array part? */
905 obj2arr(t, i - 1, value); /* set value in the array */
906 else {
907 int done = insertkey(t, key, value); /* insert key in the hash part */
908 lua_assert(done); /* it cannot fail */
909 cast(void, done); /* to avoid warnings */
910 }
911}
912
913
914static void luaH_newkey (lua_State *L, Table *t, const TValue *key,

Callers 2

reinserthashFunction · 0.85
luaH_newkeyFunction · 0.85

Calls 2

keyinarrayFunction · 0.85
insertkeyFunction · 0.85

Tested by

no test coverage detected