From 378de035de6ef4bf6d0abf7f71b0d59d6d378f8b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 3 Nov 2011 14:36:10 +0100 Subject: [PATCH] dlhist.c: dlhist_lookup: pass a variable to he_empty(). he_empty() is a macro, do not pass a function call as argument. when the macro expands, the function will be called numerous times. --- dlhist.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlhist.c b/dlhist.c index fd74160..dcc0b2b 100644 --- a/dlhist.c +++ b/dlhist.c @@ -257,9 +257,11 @@ error: int dlhist_lookup(const char *url) { - if (table_size < 1) - return 0; - return !he_empty(lookup(url)); + if (table_size) { + struct hash_entry *he = lookup(url); + return !he_empty(he); + } + return 0; } void dlhist_update(const char *url) {