From: Yehuda Sadeh Date: Wed, 1 Jun 2016 11:24:34 +0000 (-0700) Subject: rgw: reduce string copy X-Git-Tag: v11.0.0~355^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8f1f217314c32cf65ac1fa4e8e0132b501ee184;p=ceph.git rgw: reduce string copy As suggested by Casey Bodley. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 1605a04dd324..3843ee102da9 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3306,7 +3306,7 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s) ldout(store->ctx(), 10) << "NOTICE: failed to parse auth header (s=" << s << ")" << dendl; return -EINVAL; } - kv[key] = val; + kv[key] = std::move(val); } for (string& k : aws4_presigned_required_keys) { @@ -3316,9 +3316,9 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s) } } - s->aws4_auth->credential = kv["Credential"]; - s->aws4_auth->signedheaders = kv["SignedHeaders"]; - s->aws4_auth->signature = kv["Signature"]; + s->aws4_auth->credential = std::move(kv["Credential"]); + s->aws4_auth->signedheaders = std::move(kv["SignedHeaders"]); + s->aws4_auth->signature = std::move(kv["Signature"]); /* sig hex str */ dout(10) << "v4 signature format = " << s->aws4_auth->signature << dendl;