From 8f09caf9945f3c80563bc4a776b04fbba239ca71 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 18 Aug 2021 14:53:14 +0000 Subject: [PATCH] * Remove unneeded checks to improve performance git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892422 13f79535-47bb-0310-9956-ffa450edef68 --- server/util.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; -- 2.47.3