mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 05:08:57 +00:00
Use Common::ToLower and Common::ToUpper
This commit is contained in:
parent
aaec64501a
commit
6e5f4125e3
16 changed files with 29 additions and 47 deletions
|
@ -4,7 +4,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
@ -22,9 +21,8 @@ struct CaseInsensitiveStringCompare
|
|||
bool operator()(std::string_view a, std::string_view b) const
|
||||
{
|
||||
return std::lexicographical_compare(
|
||||
a.begin(), a.end(), b.begin(), b.end(), [](char lhs, char rhs) {
|
||||
return std::tolower(static_cast<u8>(lhs)) < std::tolower(static_cast<u8>(rhs));
|
||||
});
|
||||
a.begin(), a.end(), b.begin(), b.end(),
|
||||
[](char lhs, char rhs) { return Common::ToLower(lhs) < Common::ToLower(rhs); });
|
||||
}
|
||||
|
||||
static bool IsEqual(std::string_view a, std::string_view b)
|
||||
|
@ -33,7 +31,7 @@ struct CaseInsensitiveStringCompare
|
|||
return false;
|
||||
|
||||
return std::equal(a.begin(), a.end(), b.begin(), b.end(), [](char lhs, char rhs) {
|
||||
return std::tolower(static_cast<u8>(lhs)) == std::tolower(static_cast<u8>(rhs));
|
||||
return Common::ToLower(lhs) == Common::ToLower(rhs);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue