]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: removing a pessimizing move
authorRonen Friedman <rfriedma@redhat.com>
Sun, 6 Dec 2020 10:13:53 +0000 (12:13 +0200)
committerRonen Friedman <rfriedma@redhat.com>
Sun, 6 Dec 2020 16:19:49 +0000 (18:19 +0200)
"warning: moving a temporary object prevents copy elision"

Co-authored-by: Kefu Chai <kefu@redhat.com>
Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/rgw/rgw_sal_rados.h

index dec80ed903525bf56be1a59950d77200363491d0..bc522ac733b2e8775d369edb947cff41cab4d925 100644 (file)
@@ -253,7 +253,7 @@ class RGWRadosBucket : public RGWBucket {
                           bool *is_truncated, RGWUsageIter& usage_iter,
                           map<rgw_user_bucket, rgw_usage_log_entry>& usage) override;
     virtual std::unique_ptr<RGWBucket> clone() {
-      return std::move(std::unique_ptr<RGWBucket>(new RGWRadosBucket(*this)));
+      return std::make_unique<RGWRadosBucket>(*this);
     }
 
     friend class RGWRadosStore;