[PATCH 0/1] MR10805: Draft: msvcrt: only convert _tolower_l if not exact match already
This optimizations brought some speed-ups in https://gitlab.winehq.org/wine/wine/-/merge_requests/10804 for the equivalent `memicmp_strW` function as it avoids converting and locale lookup for exact matches. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10805
From: Stephan Seitz <stephan.seitz@fau.de> This optimizations brought some speed-ups in https://gitlab.winehq.org/wine/wine/-/merge_requests/10804 for the equivalent `memicmp_strW` function. --- dlls/msvcrt/string.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 6b4ffbf45b5..76749631c71 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -3435,6 +3435,9 @@ int __cdecl _memicmp_l(const void *v1, const void *v2, size_t len, _locale_t loc while (len--) { + if (*s1 == *s2) { + continue; + } if ((ret = _tolower_l(*s1, locale) - _tolower_l(*s2, locale))) break; s1++; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10805
participants (1)
-
Stephan Seitz -
Stephan Seitz (@theHamsta)