mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
IniFile: Migrate Common::CaseInsensitiveLess
to StringUtil
Migrating `Common::CaseInsensitiveLess` to StringUtil.h will hopefully discourage rolling one's own solution in the future for case-insensitive associative containers when this (quite robust!) solution already exists. `Common::CaseInsensitiveStringCompare::IsEqual` was removed in favor of using the `Common::CaseInsensitiveEquals` function. The `a.size() != b.size()` condition in `Common::CaseInsensitiveEquals` can be removed, since `std::ranges::equal` already checks this condition (confirmed in libc++).
This commit is contained in:
@ -130,7 +130,7 @@ const IniFile::Section* IniFile::GetSection(std::string_view section_name) const
|
||||
{
|
||||
for (const Section& sect : sections)
|
||||
{
|
||||
if (CaseInsensitiveStringCompare::IsEqual(sect.name, section_name))
|
||||
if (CaseInsensitiveEquals(sect.name, section_name))
|
||||
return §
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ IniFile::Section* IniFile::GetSection(std::string_view section_name)
|
||||
{
|
||||
for (Section& sect : sections)
|
||||
{
|
||||
if (CaseInsensitiveStringCompare::IsEqual(sect.name, section_name))
|
||||
if (CaseInsensitiveEquals(sect.name, section_name))
|
||||
return §
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user