From 508ccc2054590a9efa89054e742b74521f272063 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 21 Sep 2024 22:32:24 -0700 Subject: 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++). --- Source/Core/Common/IniFile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/IniFile.cpp') diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index ab20ff58fd..a7ce26976b 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -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 § } -- cgit v1.2.3