Moved helper compare strings function above

This commit is contained in:
colinmendoza121 2025-02-21 20:30:00 -05:00
parent ed09da49df
commit aab9e5fdad

View File

@ -70,6 +70,12 @@ public:
return (size[size.size() - 2] == 'G') ? num * 1024 : num;
}
static bool CompareStringsCaseInsensitive(std::string_view a, std::string_view b) {
auto lhs = a | std::views::transform(::tolower);
auto rhs = b | std::views::transform(::tolower);
return std::ranges::lexicographical_compare(lhs, rhs);
}
static bool CompareStringsAscending(GameInfo a, GameInfo b, int columnIndex) {
switch (columnIndex) {
case 1: {
@ -121,10 +127,4 @@ public:
return false;
}
}
static bool CompareStringsCaseInsensitive(std::string_view a, std::string_view b) {
auto lhs = a | std::views::transform(::tolower);
auto rhs = b | std::views::transform(::tolower);
return std::ranges::lexicographical_compare(lhs, rhs);
}
};