1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4696: get rid of boost::iequals

This commit is contained in:
Leonid Fedorov
2024-08-13 13:54:45 +00:00
committed by Leonid Fedorov
parent 90023272dd
commit 25c20bae9b
9 changed files with 63 additions and 44 deletions

View File

@ -270,4 +270,12 @@ class CollationAwareComparator : public Charset
}
};
inline bool ASCIIStringCaseInsensetiveEquals(const std::string& left, const std::string& right)
{
auto asciiLower = [](char c) { return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c; };
return left.size() == right.size() &&
std::equal(left.begin(), left.end(), right.begin(),
[&asciiLower](char l, char r) { return asciiLower(l) == asciiLower(r); });
}
} // end of namespace datatypes