]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reduce string copy 9545/head
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 1 Jun 2016 11:24:34 +0000 (04:24 -0700)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 7 Jun 2016 13:17:26 +0000 (18:47 +0530)
As suggested by Casey Bodley.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit f8f1f217314c32cf65ac1fa4e8e0132b501ee184)

src/rgw/rgw_rest_s3.cc

index a2ca9e6cc0ff845ada782ed1098c5fc6924a5560..1b54db7d2463b4d74876b9bdc79c64e9e14fb144 100644 (file)
@@ -3301,7 +3301,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) {
@@ -3311,9 +3311,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;