summaryrefslogtreecommitdiff
path: root/src/compat.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 19:41:47 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 19:41:47 +0300
commit1b52f704a005d79d00b1260b1e5bc5d6798ff7b6 (patch)
tree798c93f1007d0156635d9db63d47ae9a6328dd80 /src/compat.h
parent01e1c61e9fcf4a0b0164a7fe5395a209a50f6905 (diff)
Replace scalar loops with SIMD spans, packed stores, and direct wrap-pad checks
Diffstat (limited to 'src/compat.h')
-rw-r--r--src/compat.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compat.h b/src/compat.h
index c0ae6fa..dc345d0 100644
--- a/src/compat.h
+++ b/src/compat.h
@@ -209,10 +209,8 @@ static inline bool term_has_prefix_ci(const char *s, const char *prefix)
for (; *prefix; prefix++, s++) {
unsigned char a = (unsigned char)*s;
unsigned char b = (unsigned char)*prefix;
- if (a >= 'A' && a <= 'Z')
- a += 'a' - 'A';
- if (b >= 'A' && b <= 'Z')
- b += 'a' - 'A';
+ a |= ((unsigned)(a - 'A') < 26) ? 0x20 : 0;
+ b |= ((unsigned)(b - 'A') < 26) ? 0x20 : 0;
if (a != b)
return false;
}