1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 18:23:13 +02:00

Allow removal of hashtable entry in callback of hashtable_map

This commit is contained in:
Sebastien Helleu
2011-03-15 16:19:47 +01:00
parent dd76010e08
commit 15121096d4
+7 -3
View File
@@ -431,20 +431,24 @@ hashtable_map (struct t_hashtable *hashtable,
void *callback_map_data)
{
int i;
struct t_hashtable_item *ptr_item;
struct t_hashtable_item *ptr_item, *ptr_next_item;
if (!hashtable)
return;
for (i = 0; i < hashtable->size; i++)
{
for (ptr_item = hashtable->htable[i]; ptr_item;
ptr_item = ptr_item->next_item)
ptr_item = hashtable->htable[i];
while (ptr_item)
{
ptr_next_item = ptr_item->next_item;
(void) (callback_map) (callback_map_data,
hashtable,
ptr_item->key,
ptr_item->value);
ptr_item = ptr_next_item;
}
}
}