From Jeremy: In my previous patch, I "overfixed" hook.c. This patch
removes the changes I made to the searching for loop since those are extraneous due to the remove function call in the delete for loop.
This commit is contained in:
parent
c50a40263b
commit
e220328bdf
@ -50,19 +50,12 @@ X_PFX (hook_remove) (x_list *lst, x_hook_function *fun, void *data)
|
||||
{
|
||||
x_list *node, *cell;
|
||||
x_list *to_delete = NULL;
|
||||
x_list *prev = NULL;
|
||||
|
||||
for (node = lst; node != NULL; prev = node, node = node->next)
|
||||
for (node = lst; node != NULL; node = node->next)
|
||||
{
|
||||
cell = node->data;
|
||||
if (CELL_FUN (cell) == fun && CELL_DATA (cell) == data)
|
||||
{
|
||||
to_delete = X_PFX (list_prepend) (to_delete, cell);
|
||||
if(lst == node)
|
||||
lst = node->next;
|
||||
else
|
||||
prev->next = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
for (node = to_delete; node != NULL; node = node->next)
|
||||
|
Loading…
Reference in New Issue
Block a user