From: Yann Ylavic Date: Mon, 13 Aug 2018 12:54:30 +0000 (+0000) Subject: Axe some redundant conditions. PR 62549. X-Git-Tag: 2.5.0-alpha2-ci-test-only~2396 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a920a90838f4ad5b9b8460e539b250e2c4b7cf2d;p=thirdparty%2Fapache%2Fhttpd.git Axe some redundant conditions. PR 62549. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837941 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index aa049132d1e..fc8f2a604cf 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -711,7 +711,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache, (apr_time_sec(info->expire - info->date)) > age))) { /* make sure we don't stomp on a previous warning */ if ((warn_head == NULL) || - ((warn_head != NULL) && (ap_strstr_c(warn_head, "110") == NULL))) { + (ap_strstr_c(warn_head, "110") == NULL)) { apr_table_mergen(h->resp_hdrs, "Warning", "110 Response is stale"); } @@ -730,7 +730,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache, * the new warning to the correct *headers_out location. */ if ((warn_head == NULL) || - ((warn_head != NULL) && (ap_strstr_c(warn_head, "113") == NULL))) { + (ap_strstr_c(warn_head, "113") == NULL)) { apr_table_mergen(h->resp_hdrs, "Warning", "113 Heuristic expiration"); } @@ -787,7 +787,7 @@ int cache_check_freshness(cache_handle_t *h, cache_request_rec *cache, /* make sure we don't stomp on a previous warning */ warn_head = apr_table_get(h->resp_hdrs, "Warning"); if ((warn_head == NULL) || - ((warn_head != NULL) && (ap_strstr_c(warn_head, "110") == NULL))) { + (ap_strstr_c(warn_head, "110") == NULL)) { apr_table_mergen(h->resp_hdrs, "Warning", "110 Response is stale"); } diff --git a/modules/cache/mod_cache.c b/modules/cache/mod_cache.c index fad3df273c9..f49eb56bfc6 100644 --- a/modules/cache/mod_cache.c +++ b/modules/cache/mod_cache.c @@ -909,8 +909,8 @@ static apr_status_t cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in) /* add a revalidation warning */ warn_head = apr_table_get(r->err_headers_out, "Warning"); - if ((warn_head == NULL) || ((warn_head != NULL) - && (ap_strstr_c(warn_head, "111") == NULL))) { + if ((warn_head == NULL) || + (ap_strstr_c(warn_head, "111") == NULL)) { apr_table_mergen(r->err_headers_out, "Warning", "111 Revalidation failed"); } @@ -1901,8 +1901,8 @@ static void cache_insert_error_filter(request_rec *r) /* add a revalidation warning */ warn_head = apr_table_get(r->err_headers_out, "Warning"); - if ((warn_head == NULL) || ((warn_head != NULL) - && (ap_strstr_c(warn_head, "111") == NULL))) { + if ((warn_head == NULL) + || ap_strstr_c(warn_head, "111") == NULL) { apr_table_mergen(r->err_headers_out, "Warning", "111 Revalidation failed"); } diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index 7aac19d86e3..085371a1635 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -161,7 +161,7 @@ static const char *parse_cmd(apr_pool_t *p, const char **args, ef_filter_t *filt ++*args; /* move past leading " */ /* find true end of args string (accounting for escaped quotes) */ - while (**args && (**args != '"' || (**args == '"' && escaping))) { + while (**args && (**args != '"' || escaping)) { if (escaping) { escaping = 0; } diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 2fab52f5989..615956c34ab 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -1205,8 +1205,8 @@ static int CommandLineInterpreter(scr_t screenID, const char *commandLine) /* If we got an instance id but it doesn't match this instance of the nlm, pass it on. */ if (pID) { - pID = &pID[2]; - while (*pID && (*pID == ' ')) + pID += 2; + while (*pID == ' ') pID++; } if (pID && ap_my_addrspace && strnicmp(pID, ap_my_addrspace, strlen(ap_my_addrspace))) diff --git a/server/util.c b/server/util.c index 3c5aaf82c71..8e71d45d14c 100644 --- a/server/util.c +++ b/server/util.c @@ -851,7 +851,7 @@ AP_DECLARE(char *) ap_getword_conf2(apr_pool_t *p, const char **line) break; if (*strend == '{') ++count; - if (*strend == '\\' && strend[1] && strend[1] == '\\') { + if (*strend == '\\' && strend[1] == '\\') { ++strend; } ++strend; diff --git a/server/util_filter.c b/server/util_filter.c index e0c6ac54b57..e2952958dab 100644 --- a/server/util_filter.c +++ b/server/util_filter.c @@ -824,7 +824,7 @@ AP_DECLARE(apr_status_t) ap_filter_reinstate_brigade(ap_filter_t *f, (APR_BRIGADE_EMPTY(bb) ? "empty" : "full"), f->frec->name); - if (f->bb && !APR_BRIGADE_EMPTY(f->bb)) { + if (f->bb) { APR_BRIGADE_PREPEND(bb, f->bb); } if (!flush_upto) {