Browse code

minor optimisation

git-svn: trunk@2489

Tomasz Kojm authored on 2006/11/06 08:09:38
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Nov  6 00:02:57 CET 2006 (tk)
2
+---------------------------------
3
+  * libclamav/matcher-ac.c: minor optimisation, thanks to Christophe Jaillet
4
+
1 5
 Sun Nov  5 19:11:28 CET 2006 (acab)
2 6
 -----------------------------------
3 7
   * libclamav/regex_list.c: apply patch from Edvin to:
... ...
@@ -250,8 +250,10 @@ inline static int cli_findpos(const char *buffer, unsigned int depth, unsigned i
250 250
 	if(pattern->pattern[i] == CLI_ALT) {
251 251
 	    found = 0;
252 252
 	    for(j = 0; j < pattern->altn[alt]; j++) {
253
-		if(pattern->altc[alt][j] == buffer[bufferpos])
253
+		if(pattern->altc[alt][j] == buffer[bufferpos]) {
254 254
 		    found = 1;
255
+		    break;
256
+		}
255 257
 	    }
256 258
 
257 259
 	    if(!found)
... ...
@@ -276,8 +278,10 @@ inline static int cli_findpos(const char *buffer, unsigned int depth, unsigned i
276 276
 	    if(pattern->prefix[i] == CLI_ALT) {
277 277
 		found = 0;
278 278
 		for(j = 0; j < pattern->altn[alt]; j++) {
279
-		    if(pattern->altc[alt][j] == buffer[bufferpos])
279
+		    if(pattern->altc[alt][j] == buffer[bufferpos]) {
280 280
 			found = 1;
281
+			break;
282
+		    }
281 283
 		}
282 284
 
283 285
 		if(!found)