mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-27 06:48:33 +00:00
Merge pull request #13068 from mitaclaw/redundant-case-insensitive
IniFile: Migrate `Common::CaseInsensitiveLess` to StringUtil
This commit is contained in:
commit
b1cd4a6690
4 changed files with 19 additions and 30 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue