Skip to content

Commit e874ef6

Browse files
committed
Used move constructor instead of copy constructor when returning a string object from the encode/decode functions.
1 parent c60bf39 commit e874ef6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/network/uri/decode.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ inline
9696
std::string decoded(const std::string &input) {
9797
std::string decoded;
9898
decode(input, std::back_inserter(decoded));
99-
return decoded;
99+
return std::move(decoded);
100100
}
101101
} // namespace network
102102

include/network/uri/encode.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ inline
164164
std::string encoded(const std::string &input) {
165165
std::string encoded;
166166
encode(input, std::back_inserter(encoded));
167-
return encoded;
167+
return std::move(encoded);
168168
}
169169
} // namespace network
170170

0 commit comments

Comments
 (0)