To change fewer things with the master implementation, the Id isn't changed to lower case on creation

lower case utility functions used in comparison functions
This commit is contained in:
florent.teppe 2022-11-04 17:21:22 +01:00
parent 65cdd489fb
commit d49f60d2d6
4 changed files with 22 additions and 7 deletions

View file

@ -20,6 +20,16 @@ namespace Misc::StringUtils
return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), CiCharLess());
}
struct CiCharMore
{
bool operator()(char x, char y) const { return toLower(x) > toLower(y); }
};
inline bool ciMore(std::string_view x, std::string_view y)
{
return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), CiCharMore());
}
inline bool ciEqual(std::string_view x, std::string_view y)
{
if (std::size(x) != std::size(y))