** Insert a key in a table where there is space for that key, the ** key is valid, and the value is not nil. */
| 900 | ** key is valid, and the value is not nil. |
| 901 | */ |
| 902 | static 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 | |
| 914 | static void luaH_newkey (lua_State *L, Table *t, const TValue *key, |
no test coverage detected