mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Merge pull request #13068 from mitaclaw/redundant-case-insensitive
IniFile: Migrate `Common::CaseInsensitiveLess` to StringUtil
This commit is contained in:
@ -666,10 +666,14 @@ void ToUpper(std::string* str)
|
||||
|
||||
bool CaseInsensitiveEquals(std::string_view a, std::string_view b)
|
||||
{
|
||||
if (a.size() != b.size())
|
||||
return false;
|
||||
return std::equal(a.begin(), a.end(), b.begin(),
|
||||
[](char ca, char cb) { return Common::ToLower(ca) == Common::ToLower(cb); });
|
||||
return std::ranges::equal(
|
||||
a, b, [](char ca, char cb) { return Common::ToLower(ca) == Common::ToLower(cb); });
|
||||
}
|
||||
|
||||
bool CaseInsensitiveLess::operator()(std::string_view a, std::string_view b) const
|
||||
{
|
||||
return std::ranges::lexicographical_compare(
|
||||
a, b, [](char ca, char cb) { return Common::ToLower(ca) < Common::ToLower(cb); });
|
||||
}
|
||||
|
||||
std::string BytesToHexString(std::span<const u8> bytes)
|
||||
|
Reference in New Issue
Block a user