From f75049a4b1694e05b1e98ebec0363b668ef5e844 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 24 Mar 2002 06:42:14 +0000 Subject: [PATCH] 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 --- modules/filters/mod_include.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 13ca2fc077..389af99ebb 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 { -- 2.40.0