Use Common::ToLower and Common::ToUpper

This commit is contained in:
Pokechu22
2022-01-16 16:38:11 -08:00
parent aaec64501a
commit 6e5f4125e3
16 changed files with 29 additions and 47 deletions

View File

@ -146,13 +146,9 @@ bool FileInfoGCWii::NameCaseInsensitiveEquals(std::string_view other) const
// other is in UTF-8 and this is in Shift-JIS, so we convert so that we can compare correctly
const std::string this_utf8 = SHIFTJISToUTF8(this_ptr);
return std::equal(this_utf8.cbegin(), this_utf8.cend(), other.cbegin() + i, other.cend(),
[](char a, char b) {
return std::tolower(a, std::locale::classic()) ==
std::tolower(b, std::locale::classic());
});
[](char a, char b) { return Common::ToLower(a) == Common::ToLower(b); });
}
else if (std::tolower(*this_ptr, std::locale::classic()) !=
std::tolower(*other_ptr, std::locale::classic()))
else if (Common::ToLower(*this_ptr) != Common::ToLower(*other_ptr))
{
return false;
}