Use std::tolower with unsigned char only

This commit is contained in:
Martin Kleusberg
2019-05-01 12:15:04 +02:00
parent 14f91e95db
commit a1b43bca73

View File

@@ -18,7 +18,7 @@ bool contains(const C& container, E element)
template<typename T>
bool compare_ci(const T& a, const T& b)
{
return std::equal(a.begin(), a.end(), b.begin(), [](char c1, char c2) {
return std::equal(a.begin(), a.end(), b.begin(), [](unsigned char c1, unsigned char c2) {
// TODO: Do we need to make this UTF-8-aware?
return std::tolower(c1) == std::tolower(c2);
});