From: André Malo Date: Mon, 25 Aug 2003 02:21:20 +0000 (+0000) Subject: cleanup TOKEN_NOT tree generation code: X-Git-Tag: pre_ajp_proxy~1220 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3f2be67a7e4fe6586de7e07ae574fa18ba1cf507;p=apache cleanup TOKEN_NOT tree generation code: - remove useless stuff - shorten the code by inverting the switch/case conditions git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101090 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 58c82cfc77..7ca3933f11 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -1291,41 +1291,23 @@ static int parse_expr(include_ctx_t *ctx, const char *expr, int *was_error) root = current = new; break; } - /* Percolate upwards */ - if (current) { - switch (current->token.type) { - case TOKEN_NOT: - case TOKEN_EQ: - case TOKEN_NE: - case TOKEN_AND: - case TOKEN_OR: - case TOKEN_LBRACE: - case TOKEN_GE: - case TOKEN_GT: - case TOKEN_LE: - case TOKEN_LT: - break; - default: - ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, - "Invalid expression \"%s\" in file %s", - expr, r->filename); - *was_error = 1; - return retval; - } - } + switch (current->token.type) { + case TOKEN_STRING: + case TOKEN_RE: + case TOKEN_RBRACE: + case TOKEN_GROUP: + ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, "Invalid expression " + "\"%s\" in file %s", expr, r->filename); + *was_error = 1; + return retval; - if (!current) { - new->left = root; - new->left->parent = new; - new->parent = NULL; - root = new; - } - else { - new->left = current->right; - current->right = new; - new->parent = current; + default: + break; } + + current->right = new; + new->parent = current; current = new; break;