From: Adam C. Emerson Date: Mon, 7 Nov 2016 21:33:20 +0000 (-0500) Subject: rgw: Do not std::move to return locally constructed objects X-Git-Tag: v11.1.0~241^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec7cead38aa29caf615f579fcf4aa0567c6ca938;p=ceph.git rgw: Do not std::move to return locally constructed objects It prevents return value optimization. Signed-off-by: Adam C. Emerson --- diff --git a/src/rgw/rgw_b64.h b/src/rgw/rgw_b64.h index 36c984e815a8..52374f493635 100644 --- a/src/rgw/rgw_b64.h +++ b/src/rgw/rgw_b64.h @@ -55,7 +55,7 @@ namespace rgw { for (size_t ix = 0; ix < (psize-sref.size()); ++ix) outstr.push_back('='); - return std::move(outstr); + return outstr; } inline std::string from_base64(boost::string_ref sref) @@ -78,7 +78,7 @@ namespace rgw { std::string outstr(b64_iter(sref.data()), b64_iter(sref.data() + sref.size())); - return std::move(outstr); + return outstr; } } /* namespace */ diff --git a/src/rgw/rgw_ldap.cc b/src/rgw/rgw_ldap.cc index e8915e30daff..d07b295153e6 100644 --- a/src/rgw/rgw_ldap.cc +++ b/src/rgw/rgw_ldap.cc @@ -35,7 +35,7 @@ std::string parse_rgw_ldap_bindpw(CephContext* ctx) } } - return std::move(ldap_bindpw); + return ldap_bindpw; } #if defined(HAVE_OPENLDAP) diff --git a/src/rgw/rgw_token.h b/src/rgw/rgw_token.h index c357733e3f52..b13fe468634b 100644 --- a/src/rgw/rgw_token.h +++ b/src/rgw/rgw_token.h @@ -144,7 +144,7 @@ namespace rgw { encode_json(f); std::ostringstream os; f->flush(os); - return std::move(to_base64(std::move(os.str()))); + return to_base64(std::move(os.str())); } friend inline ostream& operator<<(ostream& os, const RGWToken& token);