{
khiter_t k;
struct ucl_hash_elt *elt;
+ size_t i;
if (hashlin == NULL) {
return;
k = kh_get (ucl_hash_caseless_node, h, obj);
if (k != kh_end (h)) {
elt = &kh_value (h, k);
+ i = elt->ar_idx;
kv_del (const ucl_object_t *, hashlin->ar, elt->ar_idx);
kh_del (ucl_hash_caseless_node, h, k);
+
+ /* Update subsequent elts */
+ for (; i < hashlin->ar.n; i ++) {
+ elt = &kh_value (h, i);
+ elt->ar_idx --;
+ }
}
}
else {
k = kh_get (ucl_hash_node, h, obj);
if (k != kh_end (h)) {
elt = &kh_value (h, k);
+ i = elt->ar_idx;
kv_del (const ucl_object_t *, hashlin->ar, elt->ar_idx);
kh_del (ucl_hash_node, h, k);
+
+ /* Update subsequent elts */
+ for (; i < hashlin->ar.n; i ++) {
+ elt = &kh_value (h, i);
+ elt->ar_idx --;
+ }
}
}
}