From e7fbb6a7d93887ade7c00fe28acba498074fca20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B6r=C3=B6k=20Edvin?= Date: Mon, 11 Apr 2011 21:27:04 +0300 Subject: [PATCH] matcher-ac: optimize the not-taken case This generates more efficient code for the trie traversing loop, using registers instead of stack locations for the variables. --- libclamav/matcher-ac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libclamav/matcher-ac.c b/libclamav/matcher-ac.c index 4e01f44ad..3e799a8ee 100644 --- a/libclamav/matcher-ac.c +++ b/libclamav/matcher-ac.c @@ -1169,7 +1169,7 @@ int cli_ac_scanbuff(const unsigned char *buffer, uint32_t length, const char **v for(i = 0; i < length; i++) { current = current->trans[buffer[i]]; - if(IS_FINAL(current)) { + if(UNLIKELY(IS_FINAL(current))) { faillist = NULL; patt = current->list; if(IS_LEAF(current)) {