From 50622d1102dbd0e44baf5353c85dad4e63911c31 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 1 Apr 2015 14:25:21 +0200 Subject: [PATCH] simplified hook_lookup() --- server/src/hooks.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/hooks.c b/server/src/hooks.c index eb2df689c..72b690915 100644 --- a/server/src/hooks.c +++ b/server/src/hooks.c @@ -27,15 +27,13 @@ static struct hook_id hook_list[] = { { hook_tofixed, "tofixed" }, { hook_ts, "ts" }, { hook_fir, "fir" }, - { NULL } }; hook_cb_t hook_lookup(const char *name) { - for (struct hook_id *hid = hook_list; hid->cb; hid++) { - if (!strcmp(name, hid->name)) { - return hid->cb; - } + for (int i=0; i