Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite874ef6

Browse files
committed
Used move constructor instead of copy constructor when returning a string object from the encode/decode functions.
1 parentc60bf39 commite874ef6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎include/network/uri/decode.hpp‎

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

‎include/network/uri/encode.hpp‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp