From f8f1f217314c32cf65ac1fa4e8e0132b501ee184 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 1 Jun 2016 04:24:34 -0700 Subject: [PATCH] rgw: reduce string copy As suggested by Casey Bodley. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rest_s3.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.47.3