]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: Remove pessimizing move of return values
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 10 Apr 2017 17:12:08 +0000 (13:12 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 11 Apr 2017 01:57:14 +0000 (21:57 -0400)
commit3c4811fad36a556e5a38539b753b3158b3d4c64b
tree84a1b4efe7eb8ab92f9ff44f636c295b6fa00c83
parent5b517ad4cf48270c5cec5506c2cf9cd486ccbdba
rgw: Remove pessimizing move of return values

C++ performs copy elision of return values if:

1. The value is a local declared in the function (i.e. not a
   parameter)
2. The type of the value in the return statement is, modulo
   const-value qualification, identical to the return type of the
   function.

An RValue reference to a type is not identical, modulo const-value
qualification, to the type it is a reference to.

Do not std::move local values in the return statement unless the value
is a parameter or you will make the compiler perform a copy it would
iotherwise avoid.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_auth_s3.cc