Skip to content

Commit 27b230a

Browse files
committed
Change methods to declare constness of returns
1 parent 8686134 commit 27b230a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/httpserver/string_utilities.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ namespace string_utilities
3939
* @param str The string to turn uppercase
4040
* @return a string that is the uppercase version of the previous
4141
**/
42-
std::string to_upper_copy(const std::string& str);
43-
std::string to_lower_copy(const std::string& str);
44-
std::vector<std::string> string_split(const std::string& s,
42+
const std::string to_upper_copy(const std::string& str);
43+
const std::string to_lower_copy(const std::string& str);
44+
const std::vector<std::string> string_split(const std::string& s,
4545
char sep = ' ', bool collapse = true
4646
);
47-
std::string regex_replace(const std::string& str, const std::string& pattern,
47+
const std::string regex_replace(const std::string& str, const std::string& pattern,
4848
const std::string& replace_str
4949
);
5050
void to_upper(std::string& str);

src/string_utilities.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace httpserver
3434
namespace string_utilities
3535
{
3636

37-
std::string to_upper_copy(const std::string& str)
37+
const std::string to_upper_copy(const std::string& str)
3838
{
3939
std::string result = str;
4040
std::transform(result.begin(),
@@ -55,7 +55,7 @@ void to_upper(std::string& str)
5555
);
5656
}
5757

58-
std::string to_lower_copy(const std::string& str)
58+
const std::string to_lower_copy(const std::string& str)
5959
{
6060
std::string result = str;
6161
std::transform(result.begin(),
@@ -67,7 +67,7 @@ std::string to_lower_copy(const std::string& str)
6767
return result;
6868
}
6969

70-
std::vector<std::string> string_split(
70+
const std::vector<std::string> string_split(
7171
const std::string& s,
7272
char sep,
7373
bool collapse
@@ -84,7 +84,7 @@ std::vector<std::string> string_split(
8484
return result;
8585
}
8686

87-
std::string regex_replace(const std::string& str,
87+
const std::string regex_replace(const std::string& str,
8888
const std::string& pattern,
8989
const std::string& replace_str
9090
)

0 commit comments

Comments
 (0)