// and re-adding it, so the existing key remains valid.
json_object *existing_value = NULL;
struct lh_entry *existing_entry;
- existing_entry = lh_table_lookup_entry(jso->o.c_object, (void*)key);
+ const unsigned long hash = lh_get_hash(jso->o.c_object, (void*)key);
+ existing_entry = lh_table_lookup_entry_w_hash(jso->o.c_object, (void*)key, hash);
if (!existing_entry)
{
- lh_table_insert(jso->o.c_object, strdup(key), val);
+ lh_table_insert_w_hash(jso->o.c_object, strdup(key), val, hash, 0);
return;
}
- existing_value = (void *)existing_entry->v;
+ existing_value = (json_object *)existing_entry->v;
if (existing_value)
json_object_put(existing_value);
existing_entry->v = val;