From: André Malo Date: Sun, 17 Oct 2004 17:05:59 +0000 (+0000) Subject: minor optimizations X-Git-Tag: 2.1.1~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb5a48b58e003d6b7b077029bc36c5d9ec9efc10;p=apache minor optimizations git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105506 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/experimental/mod_filter.c b/modules/experimental/mod_filter.c index 3eb8b1f50b..13192b2a79 100644 --- a/modules/experimental/mod_filter.c +++ b/modules/experimental/mod_filter.c @@ -476,7 +476,7 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *fname, else { provider = apr_palloc(cmd->pool, sizeof(ap_filter_provider_t)); - if (match[0] == '!') { + if (*match == '!') { provider->not = 1; ++match; } @@ -484,22 +484,22 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *fname, provider->not = 0; } - switch (match[0]) { + switch (*match++) { case '<': provider->match_type = INT_LT; - provider->match.number = atoi(match+1); + provider->match.number = atoi(match); break; case '>': provider->match_type = INT_GT; - provider->match.number = atoi(match+1); + provider->match.number = atoi(match); break; case '=': provider->match_type = INT_EQ; - provider->match.number = atoi(match+1); + provider->match.number = atoi(match); break; case '/': provider->match_type = REGEX_MATCH; - rxend = ap_strchr_c(match+1, '/'); + rxend = ap_strchr_c(match, '/'); if (!rxend) { return "Bad regexp syntax"; } @@ -511,8 +511,8 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *fname, } provider->match.regex = ap_pregcomp(cmd->pool, apr_pstrndup(cmd->pool, - match+1, - rxend-match-1), + match, + rxend-match), flags); break; case '*': @@ -521,13 +521,13 @@ static const char *filter_provider(cmd_parms *cmd, void *CFG, const char *fname, break; case '$': provider->match_type = STRING_CONTAINS; - str = apr_pstrdup(cmd->pool, match+1); + str = apr_pstrdup(cmd->pool, match); ap_str_tolower(str); provider->match.string = str; break; default: provider->match_type = STRING_MATCH; - provider->match.string = apr_pstrdup(cmd->pool, match); + provider->match.string = apr_pstrdup(cmd->pool, match-1); break; } provider->frec = provider_frec;