mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
optimize toLower()
This commit is contained in:
@@ -655,21 +655,8 @@ std::string Helpers::toLower(std::string const & s) {
|
|||||||
return lc;
|
return lc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO fix toLower
|
|
||||||
std::string Helpers::toLower(const char * s) {
|
std::string Helpers::toLower(const char * s) {
|
||||||
std::string lc = s;
|
return toLower(std::string(s));
|
||||||
std::transform(lc.begin(), lc.end(), lc.begin(), [](unsigned char c) { return std::tolower(c); });
|
|
||||||
return lc;
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
for (; *s; ++s) {
|
|
||||||
*p = tolower(*s);
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Helpers::toUpper(std::string const & s) {
|
std::string Helpers::toUpper(std::string const & s) {
|
||||||
|
|||||||
Reference in New Issue
Block a user