]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: reduce string copy 9209/head
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 1 Jun 2016 11:24:34 +0000 (04:24 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 1 Jun 2016 11:24:34 +0000 (04:24 -0700)
As suggested by Casey Bodley.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest_s3.cc

index 1605a04dd324f601500bde0f851aecb8dad3a97a..3843ee102da9dc883d2b12ab26fa803339570218 100644 (file)
@@ -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;