From 9741b5f6bd0364724f6b8a6a2c414192d3a7e7eb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 27 Oct 2015 10:00:52 +0000 Subject: CompareString considered slow and therefore removed git-svn-id: http://svn.miranda-ng.org/main/trunk@15624 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/src/utils.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp index 7ef78fd593..91b057b301 100644 --- a/src/mir_core/src/utils.cpp +++ b/src/mir_core/src/utils.cpp @@ -402,7 +402,7 @@ MIR_CORE_DLL(int) mir_strcmp(const char *p1, const char *p2) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringA(LOCALE_USER_DEFAULT, 0, p1, -1, p2, -1) - 2; + return strcmp(p1, p2); } MIR_CORE_DLL(int) mir_wstrcmp(const wchar_t *p1, const wchar_t *p2) @@ -411,7 +411,7 @@ MIR_CORE_DLL(int) mir_wstrcmp(const wchar_t *p1, const wchar_t *p2) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringW(LOCALE_USER_DEFAULT, 0, p1, -1, p2, -1) - 2; + return wcscmp(p1, p2); } MIR_CORE_DLL(int) mir_strcmpi(const char *p1, const char *p2) @@ -420,7 +420,7 @@ MIR_CORE_DLL(int) mir_strcmpi(const char *p1, const char *p2) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, -1, p2, -1) - 2; + return stricmp(p1, p2); } MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2) @@ -429,7 +429,7 @@ MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, -1, p2, -1) - 2; + return wcsicmp(p1, p2); } MIR_CORE_DLL(int) mir_strncmp(const char *p1, const char *p2, size_t n) @@ -438,7 +438,7 @@ MIR_CORE_DLL(int) mir_strncmp(const char *p1, const char *p2, size_t n) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringA(LOCALE_USER_DEFAULT, 0, p1, (int)n, p2, (int)n) - 2; + return strncmp(p1, p2, n); } MIR_CORE_DLL(int) mir_wstrncmp(const wchar_t *p1, const wchar_t *p2, size_t n) @@ -447,7 +447,7 @@ MIR_CORE_DLL(int) mir_wstrncmp(const wchar_t *p1, const wchar_t *p2, size_t n) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringW(LOCALE_USER_DEFAULT, 0, p1, (int)n, p2, (int)n) - 2; + return wcsncmp(p1, p2, n); } MIR_CORE_DLL(int) mir_strncmpi(const char *p1, const char *p2, size_t n) @@ -456,7 +456,7 @@ MIR_CORE_DLL(int) mir_strncmpi(const char *p1, const char *p2, size_t n) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, (int)n, p2, (int)n) - 2; + return strnicmp(p1, p2, n); } MIR_CORE_DLL(int) mir_wstrncmpi(const wchar_t *p1, const wchar_t *p2, size_t n) @@ -465,7 +465,7 @@ MIR_CORE_DLL(int) mir_wstrncmpi(const wchar_t *p1, const wchar_t *p2, size_t n) return (p2 == NULL) ? 0 : -1; if (p2 == NULL) return 1; - return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, (int)n, p2, (int)n) - 2; + return wcsnicmp(p1, p2, n); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3