minor optimisation

git-svn: trunk@3220
remotes/push_mirror/metadata
Tomasz Kojm 18 years ago
parent fb1487297c
commit c01ff22d4b
  1. 4
      ChangeLog
  2. 6
      libclamav/matcher-ac.c

@ -1,3 +1,7 @@
Fri Sep 14 20:16:20 CEST 2007 (tk)
----------------------------------
* libclamav/matcher-ac.c: minor optimisation
Fri Sep 14 10:03:22 BST 2007 (njh)
----------------------------------
* libclamav/message.c: --enable-debug: fix assertion (thanks to Edvin)

@ -619,7 +619,7 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
struct cli_ac_patt *new;
char *pt, *hex = NULL;
uint16_t i, j, ppos = 0, pend;
uint8_t wprefix = 0, error = 0, namelen, plen = 0;
uint8_t wprefix = 0, zprefix = 1, error = 0, namelen, plen = 0;
int ret;
#define FREE_ALT \
@ -760,9 +760,11 @@ int cli_ac_addsig(struct cli_matcher *root, const char *virname, const char *hex
wprefix = 1;
break;
}
if(zprefix && new->pattern[i])
zprefix = 0;
}
if(wprefix) {
if(wprefix || zprefix) {
pend = new->length - root->ac_mindepth + 1;
for(i = 0; i < pend; i++) {
for(j = i; j < i + root->ac_maxdepth && j < new->length; j++) {

Loading…
Cancel
Save