From: Ruediger Pluem Date: Wed, 18 Aug 2021 14:53:14 +0000 (+0000) Subject: * Remove unneeded checks to improve performance X-Git-Tag: 2.5.0-alpha2-ci-test-only~868 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f09caf9945f3c80563bc4a776b04fbba239ca71;p=thirdparty%2Fapache%2Fhttpd.git * Remove unneeded checks to improve performance git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892422 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util.c b/server/util.c index 6bc5063bc39..d56af387671 100644 --- a/server/util.c +++ b/server/util.c @@ -2607,7 +2607,7 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring) * If we find a slosh, and it's not the last byte in the string, * it's escaping something - advance past both bytes. */ - if ((*inchr == '\\') && (inchr[1] != '\0')) { + else if ((*inchr == '\\') && (inchr[1] != '\0')) { inchr++; newlen++; } @@ -2624,12 +2624,10 @@ AP_DECLARE(char *) ap_escape_quotes(apr_pool_t *p, const char *instring) if (*inchr == '"') { *outchr++ = '\\'; } - if ((*inchr == '\\') && (inchr[1] != '\0')) { - *outchr++ = *inchr++; - } - if (*inchr != '\0') { + else if ((*inchr == '\\') && (inchr[1] != '\0')) { *outchr++ = *inchr++; } + *outchr++ = *inchr++; } *outchr = '\0'; return outstring;