Skip to content

Commit 0488cee

Browse files
committed
util_string cleanup: Remove const-ref arg rtrim
The by-value version is always better as we need to copy the argument anyway, and now it can be a move instead.
1 parent 8e22cd4 commit 0488cee

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

src/util_string.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,6 @@ namespace Sass {
6161
}
6262
// EO unvendor
6363

64-
std::string rtrim(const std::string& str) {
65-
66-
std::string trimmed = str;
67-
size_t pos_ws = trimmed.find_last_not_of(" \t\n\v\f\r");
68-
if (pos_ws != std::string::npos) {
69-
trimmed.erase(pos_ws + 1);
70-
}
71-
else {
72-
trimmed.clear();
73-
}
74-
return trimmed;
75-
}
76-
7764
std::string normalize_newlines(const std::string& str) {
7865
std::string result;
7966
result.reserve(str.size());

src/util_string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Sass {
2222
// ###########################################################################
2323
std::string unvendor(const std::string& name);
2424

25-
std::string rtrim(const std::string& str);
25+
std::string rtrim(std::string str);
2626
std::string normalize_newlines(const std::string& str);
2727
std::string normalize_underscores(const std::string& str);
2828
std::string normalize_decimals(const std::string& str);

0 commit comments

Comments
 (0)