Commit 5b42781b authored by Christoph Mallon's avatar Christoph Mallon
Browse files

hooks: Cleanup.

parent cd11bb60
......@@ -29,18 +29,11 @@ void register_hook(hook_type_t hook, hook_entry_t *entry)
void unregister_hook(hook_type_t hook, hook_entry_t *entry)
{
if (hooks[hook] == entry) {
hooks[hook] = entry->next;
entry->next = NULL;
return;
}
hook_entry_t *p;
for (p = hooks[hook]; p && p->next != entry; p = p->next) {
}
if (p != NULL) {
p->next = entry->next;
entry->next = NULL;
for (hook_entry_t **p = &hooks[hook]; *p; p = &(*p)->next) {
if (*p == entry) {
*p = entry->next;
entry->next = NULL;
break;
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment