From effdfa2d9825daa0ae98990c130af1fc7efe83ad Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Tue, 20 Nov 2001 03:03:17 +0000 Subject: [PATCH] optimized away some pointer arithmetic in the inner loop of the BNDM string-search function git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92046 13f79535-47bb-0310-9956-ffa450edef68 --- modules/filters/mod_include.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 8c4f287c1f..e1f7112566 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -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; -- 2.40.0