scanner-utils: optimize str()/lit() Replace the dog-slow unneeded strncasecmp() with an inlineable memcmp(). Before: compiled 2500 keymaps in 8.348715629s After: compiled 2500 keymaps in 7.872640338s Signed-off-by: Ran Benita <ran234@gmail.com>
diff --git a/src/scanner-utils.h b/src/scanner-utils.h
index e4e90eb..fc231ab 100644
--- a/src/scanner-utils.h
+++ b/src/scanner-utils.h
@@ -130,7 +130,7 @@ str(struct scanner *s, const char *string, size_t len)
{
if (s->len - s->pos < len)
return false;
- if (strncasecmp(s->s + s->pos, string, len) != 0)
+ if (memcmp(s->s + s->pos, string, len) != 0)
return false;
s->pos += len; s->column += len;
return true;