mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-05 08:10:05 +00:00
fix clang warning
This commit is contained in:
parent
1189dc4b78
commit
ef8218996c
@ -168,11 +168,12 @@ COSMO_API CValue* cosmoT_insert(CState *state, CTable *tbl, CValue key) {
|
|||||||
// insert into the table
|
// insert into the table
|
||||||
CTableEntry *entry = findEntry(tbl->table, tbl->capacity - 1, key); // -1 for our capacity mask
|
CTableEntry *entry = findEntry(tbl->table, tbl->capacity - 1, key); // -1 for our capacity mask
|
||||||
|
|
||||||
if (IS_NIL(entry->key))
|
if (IS_NIL(entry->key)) {
|
||||||
if (IS_NIL(entry->val)) // is it empty?
|
if (IS_NIL(entry->val)) // is it empty?
|
||||||
tbl->count++;
|
tbl->count++;
|
||||||
else // it's a tombstone, mark it alive!
|
else // it's a tombstone, mark it alive!
|
||||||
tbl->tombstones--;
|
tbl->tombstones--;
|
||||||
|
}
|
||||||
|
|
||||||
entry->key = key;
|
entry->key = key;
|
||||||
return &entry->val;
|
return &entry->val;
|
||||||
|
Loading…
Reference in New Issue
Block a user