1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

fix(): fix the naming

This commit is contained in:
Roman Nozdrin
2024-08-17 20:54:51 +00:00
committed by Leonid Fedorov
parent 25c20bae9b
commit e2941628d1

View File

@ -149,18 +149,18 @@ class Charset
bool operator==(const Charset& rhs) bool operator==(const Charset& rhs)
{ {
return rhs.getCharset().cs_name.str == getCharset().cs_name.str; return rhs.getCharset().cs_name.str == getCharset().cs_name.str;
} }
std::string convert(const std::string& from, const datatypes::Charset& fromCs) const std::string convert(const std::string& from, const datatypes::Charset& fromCs) const
{ {
std::string result; std::string result;
uint dummy_errors; uint dummy_errors;
result.resize(from.size() * getCharset().mbmaxlen); result.resize(from.size() * getCharset().mbmaxlen);
size_t resultingSize = my_convert(const_cast<char*>(result.c_str()), result.size(), &getCharset(), from.c_str(), size_t resultingSize = my_convert(const_cast<char*>(result.c_str()), result.size(), &getCharset(),
from.size(), &fromCs.getCharset(), &dummy_errors); from.c_str(), from.size(), &fromCs.getCharset(), &dummy_errors);
result.resize(resultingSize); result.resize(resultingSize);
return result; return result;
} }
Charset(uint32_t charsetNumber); Charset(uint32_t charsetNumber);
@ -187,7 +187,7 @@ class Charset
// please note that ConstString has an assertion so that nullptr data has zero length. // please note that ConstString has an assertion so that nullptr data has zero length.
const char* s1 = str1.str(); const char* s1 = str1.str();
const char* s2 = str2.str(); const char* s2 = str2.str();
return mCharset->strnncollsp(s1 ? s1 : "", str1.length(), s2 ? s2 : "" , str2.length()); return mCharset->strnncollsp(s1 ? s1 : "", str1.length(), s2 ? s2 : "", str2.length());
} }
int strnncollsp(const char* str1, size_t length1, const char* str2, size_t length2) const int strnncollsp(const char* str1, size_t length1, const char* str2, size_t length2) const
{ {
@ -272,10 +272,10 @@ class CollationAwareComparator : public Charset
inline bool ASCIIStringCaseInsensetiveEquals(const std::string& left, const std::string& right) inline bool ASCIIStringCaseInsensetiveEquals(const std::string& left, const std::string& right)
{ {
auto asciiLower = [](char c) { return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c; }; auto asciiHigher = [](char c) { return (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c; };
return left.size() == right.size() && return left.size() == right.size() &&
std::equal(left.begin(), left.end(), right.begin(), std::equal(left.begin(), left.end(), right.begin(),
[&asciiLower](char l, char r) { return asciiLower(l) == asciiLower(r); }); [&asciiHigher](char l, char r) { return asciiHigher(l) == asciiHigher(r); });
} }
} // end of namespace datatypes } // end of namespace datatypes