From: Brian Pane Date: Sun, 24 Mar 2002 06:42:14 +0000 (+0000) Subject: Small performance optimization for find_end_sequence(): when we find X-Git-Tag: 2.0.34~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f75049a4b1694e05b1e98ebec0363b668ef5e844;p=thirdparty%2Fapache%2Fhttpd.git Small performance optimization for find_end_sequence(): when we find the start of a directive, scan through the rest of it in a minimal loop before popping back out to the main char-at-a-time parser loop git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94153 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 13ca2fc0776..389af99ebb2 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -609,10 +609,15 @@ static apr_bucket *find_end_sequence(apr_bucket *dptr, include_ctx_t *ctx, if (ctx->state == PARSE_DIRECTIVE) { if (ctx->tag_length == 0) { if (!apr_isspace(*c)) { + const char *tmp = c; ctx->tag_start_bucket = dptr; ctx->tag_start_index = c - buf; - ctx->tag_length = 1; - ctx->directive_length = 1; + do { + c++; + } while ((c < buf + len) && !apr_isspace(*c) && + *c != *str); + ctx->tag_length = ctx->directive_length = c - tmp; + continue; } } else {