]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw/rgw_rest_sts: return local variable w/o std::move() 41063/head
authorKefu Chai <kchai@redhat.com>
Wed, 28 Apr 2021 12:13:48 +0000 (20:13 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 28 Apr 2021 12:16:01 +0000 (20:16 +0800)
commit60daa3893565c6bd69ec373c2d29e3a959ea6702
tree9e5cdc6bdc6ae8aa4fe47ee931f26b05c235599a
parentf7294bca9d392ff58a8854902e4c370dc693205b
rgw/rgw_rest_sts: return local variable w/o std::move()

in C++17, the C++ standard ensures that the return value in this case
can be optimized with copy elision, adding std::move() is not necessary,
and prevents copy elision from happening.

this change also silences the warning of:

../src/rgw/rgw_rest_sts.cc: In member function 'std::unique_ptr<rgw::sal::RGWOIDCProvider> rgw::auth::sts::WebTokenEngine::get_provider(const DoutPrefixProvider*, const string&, const string&) const':
../src/rgw/rgw_rest_sts.cc:92:19: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move]
   92 |   return std::move(provider);
      |          ~~~~~~~~~^~~~~~~~~~
../src/rgw/rgw_rest_sts.cc:92:19: note: remove 'std::move' call

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/rgw/rgw_rest_sts.cc