hecl/hecl: Make use of std::char_traits with StrNCmp

Same behavior, but allows removing the use of ifdefs, unifying the code
paths.
This commit is contained in:
Lioncash 2019-08-15 01:11:39 -04:00
parent ef6b41ea15
commit c513a4b61f
1 changed files with 2 additions and 5 deletions

View File

@ -311,11 +311,8 @@ inline int StrCmp(const SystemChar* str1, const SystemChar* str2) {
inline int StrNCmp(const SystemChar* str1, const SystemChar* str2, size_t count) {
if (!str1 || !str2)
return str1 != str2;
#if HECL_UCS2
return wcsncmp(str1, str2, count);
#else
return strncmp(str1, str2, count);
#endif
return std::char_traits<SystemChar>::compare(str1, str2, count);
}
inline int StrCaseCmp(const SystemChar* str1, const SystemChar* str2) {