summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2022-06-26 23:37:42 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2022-07-01 14:22:06 -0400
commitaaf36f5838f0993d8572d85f4efa974eeff2d7ae (patch)
treef6f17d82ea79d3d366bd679f3ffc55f22a311fa1 /src
parent5fef5e22089e26adc2d72f27b5b7fb9128c50eff (diff)
downloadlighttpd-git-aaf36f5838f0993d8572d85f4efa974eeff2d7ae.tar.gz
[core] perf tweak buffer_eq_icase_ssn()
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/buffer.c b/src/buffer.c
index a0eae151..869a1073 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -397,13 +397,7 @@ int buffer_eq_icase_ssn(const char * const a, const char * const b, const size_t
for (size_t i = 0; i < len; ++i) {
unsigned int ca = ((unsigned char *)a)[i];
unsigned int cb = ((unsigned char *)b)[i];
- if (ca != cb) {
- ca |= 0x20;
- cb |= 0x20;
- if (ca != cb) return 0;
- if (!light_islower(ca)) return 0;
- if (!light_islower(cb)) return 0;
- }
+ if (ca != cb && ((ca ^ cb) != 0x20 || !light_isalpha(ca))) return 0;
}
return 1;
}