]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Axe some redundant conditions. PR 62549.
authorYann Ylavic <ylavic@apache.org>
Mon, 13 Aug 2018 12:54:30 +0000 (12:54 +0000)
committerYann Ylavic <ylavic@apache.org>
Mon, 13 Aug 2018 12:54:30 +0000 (12:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837941 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/cache_util.c
modules/cache/mod_cache.c
modules/filters/mod_ext_filter.c
server/mpm/netware/mpm_netware.c
server/util.c
server/util_filter.c

index aa049132d1e32d48e46030ea91e93886f67c54ce..fc8f2a604cf25c88a34bebdac73b8c6e5bc05514 100644 (file)
@@ -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");
         }
index fad3df273c92ea12fcb13260526eb9234ce8c9dc..f49eb56bfc6db3015f8684ae183389d0734efe28 100644 (file)
@@ -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");
             }
index 7aac19d86e38ba68a7e89806b5d376f852eb4513..085371a1635a7f632959b07501b79c246fab8666 100644 (file)
@@ -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;
             }
index 2fab52f5989aee1a4e29a517347ccbf0f3a0802d..615956c34ab5c37877c4b8ca8ebb051245030a76 100644 (file)
@@ -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)))
index 3c5aaf82c710408281eb058d1c2812e65f87f48e..8e71d45d14c30510164dd1ed64acee8b17471a9b 100644 (file)
@@ -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;
index e0c6ac54b576ef9c597351d636a4ff815ad57769..e2952958dab6370effc4b4ea88b3a3e4f41eb954 100644 (file)
@@ -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) {