Update string.cpp

This commit is contained in:
6arelyFuture 2022-11-25 20:11:01 +00:00 committed by GitHub
parent 416036d25e
commit 41d4b5781d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,7 @@ std::vector<std::string> split(const std::string& s, const char delim) {
return elems;
}
std::string to_lower(const std::string text) {
std::string to_lower(const std::string& text) {
std::string result;
std::ranges::transform(text, std::back_inserter(result),
[](const unsigned char input) {
@ -41,7 +41,7 @@ std::string to_lower(const std::string text) {
return text;
}
std::string to_upper(const std::string text) {
std::string to_upper(const std::string& text) {
std::string result;
std::ranges::transform(text, std::back_inserter(result),
[](const unsigned char input) {