1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-26 15:13:16 +00:00

Fix janet_table_remove returning the key instead of the value

This commit is contained in:
GrayJack 2020-07-01 20:05:07 -03:00
parent e08235b575
commit 7ea1c7d85a
No known key found for this signature in database
GPG Key ID: 12C54E04AAB9931E

View File

@ -173,7 +173,7 @@ Janet janet_table_rawget(JanetTable *t, Janet key) {
Janet janet_table_remove(JanetTable *t, Janet key) {
JanetKV *bucket = janet_table_find(t, key);
if (NULL != bucket && !janet_checktype(bucket->key, JANET_NIL)) {
Janet ret = bucket->key;
Janet ret = bucket->value;
t->count--;
t->deleted++;
bucket->key = janet_wrap_nil();