Skip to content

Commit

Permalink
From Jeremy: In my previous patch, I "overfixed" hook.c. This patch
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ben Byer committed Nov 17, 2007
1 parent 841e715 commit 2abc2b2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions hw/darwin/quartz/xpr/x-hook.c
Expand Up @@ -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)
Expand Down

0 comments on commit 2abc2b2

Please sign in to comment.