From 2c7c9ec32ab91a07a2a413ee69c6c6f24eedfc42 Mon Sep 17 00:00:00 2001 From: Alug Date: Thu, 11 Dec 2025 20:10:01 +0100 Subject: [PATCH] fastcmp.h: mark fastcmp functions as pure this might let the compiler optimize aways subsequent calls in some cases strcmp etc from glibc also does it prayin nothin changes the locale at runtime lmao --- src/fastcmp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fastcmp.h b/src/fastcmp.h index 0f7c24aaa..1b92e42e8 100644 --- a/src/fastcmp.h +++ b/src/fastcmp.h @@ -3,14 +3,14 @@ // returns false if s != c // returns true if s == c -FUNCINLINE static ATTRINLINE boolean fasticmp(const char *s, const char *c) +FUNCINLINE static ATTRINLINE PUREFUNC boolean fasticmp(const char *s, const char *c) { for (; *s && toupper(*s) == toupper(*c); s++, c++) ; return (*s == *c); // make sure both strings ended } // case-sensitive of the above -FUNCINLINE static ATTRINLINE boolean fastcmp(const char *s, const char *c) +FUNCINLINE static ATTRINLINE PUREFUNC boolean fastcmp(const char *s, const char *c) { for (; *s && *s == *c; s++, c++) ; return (*s == *c); // make sure both strings ended @@ -18,7 +18,7 @@ FUNCINLINE static ATTRINLINE boolean fastcmp(const char *s, const char *c) // length-limited of the above // only true if both strings are at least l characters long AND match, case-sensitively! -FUNCINLINE static ATTRINLINE boolean fastncmp(const char *s, const char *c, UINT16 l) +FUNCINLINE static ATTRINLINE PUREFUNC boolean fastncmp(const char *s, const char *c, UINT16 l) { for (; *s && *s == *c && --l; s++, c++) ; return !l; // make sure you reached the end