Skip to content

Commit e9da6f8

Browse files
Allow to avoid a string copy in string_response constructor (etr#201)
1 parent cbaa3f3 commit e9da6f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/httpserver/string_response.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class string_response : public http_response
3636
string_response() = default;
3737

3838
explicit string_response(
39-
const std::string& content,
39+
std::string content,
4040
int response_code = http::http_utils::http_ok,
4141
const std::string& content_type = http::http_utils::text_plain
4242
):
4343
http_response(response_code, content_type),
44-
content(content)
44+
content(std::move(content))
4545
{
4646
}
4747

0 commit comments

Comments
 (0)