]> granicus.if.org Git - apache/commitdiff
optimized away some pointer arithmetic in the inner loop of the BNDM string-search...
authorBrian Pane <brianp@apache.org>
Tue, 20 Nov 2001 03:03:17 +0000 (03:03 +0000)
committerBrian Pane <brianp@apache.org>
Tue, 20 Nov 2001 03:03:17 +0000 (03:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92046 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_include.c

index 8c4f287c1fc007cde5494ae69a5fe7ad844bf9f2..e1f7112566a82a617987447c81ee15974cc9c578 100644 (file)
@@ -255,7 +255,7 @@ static void bndm_compile(bndm_t *t, const char *n, apr_size_t nl)
 static apr_size_t bndm(const char *n, apr_size_t nl, const char *h, 
                        apr_size_t hl, bndm_t *t)
 {
-    apr_size_t skip;
+    const char *skip;
     const char *he, *p, *pi;
     unsigned int *T, x, d;
 
@@ -268,18 +268,19 @@ static apr_size_t bndm(const char *n, apr_size_t nl, const char *h,
     p = pi + nl; /* compare window right to left. point to the first char */
 
     while (p < he) {
-        skip = nl;
+        skip = p;
         d = x;
         do {
             d = (d >> 1) & T[(unsigned char) *p--];
             if ((d & 1)) {
                 if (p != pi)
-                    skip = p - pi;
+                    skip = p;
                 else
                     return p - h + 1;
             }
         } while (d > 1);
-        p = (pi += skip) + nl; 
+        pi = skip;
+        p = pi + nl;
     }
 
     return hl;