Commit
9677cd33eea4c65d78ba463b46b8b45ed2da1709 made it possible to
remove current entry when iterating through all hash entries. However,
it didn't properly handle a special case of removing first entry
assigned to a given key which contains several entries in its collision
list.
while (entry) {
virHashEntryPtr next = entry->next;
if (entry->valid) {
+ void *name = (entry == table->table + i) ? entry->name : NULL;
+
table->current = entry;
iter(entry->payload, entry->name, data);
table->current = NULL;
count++;
+
+ /* revisit current entry if it was the first one in collision
+ * list and its content changed, i.e. it was deleted by iter()
+ */
+ if (name && name != entry->name)
+ continue;
}
entry = next;
}