bool operator == (const item_t &o) { return *this == o.key; }
bool is_unused () const { return key == kINVALID; }
bool is_tombstone () const { return key != kINVALID && value == vINVALID; }
+ bool is_real () const { return key != kINVALID && value != vINVALID; }
};
hb_object_header_t header;
/* Insert back old items. */
if (old_items)
for (unsigned int i = 0; i < old_size; i++)
- if (old_items[i].key != kINVALID && old_items[i].value != vINVALID)
+ if (old_items[i].is_real ())
set (old_items[i].key, old_items[i].value);
free (old_items);
{
if (unlikely (!items)) return vINVALID;
unsigned int i = bucket_for (key);
- return !items[i].is_unused () && items[i] == key ? items[i].value : vINVALID;
+ return items[i].is_real () && items[i] == key ? items[i].value : vINVALID;
}
void del (K key) { set (key, vINVALID); }