]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: move() explicitly to avoid copy
authorKefu Chai <kchai@redhat.com>
Sat, 11 Jan 2020 08:26:54 +0000 (16:26 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 11 Jan 2020 15:12:27 +0000 (23:12 +0800)
to silence following warnings from clang 9.0.1:

src/crimson/osd/heartbeat.cc:143:14: warning: local variable 'extras' will be copied despite being returned by name [-Wreturn-std-move]
      return extras;
             ^~~~~~
../src/crimson/osd/heartbeat.cc:143:14: note: call 'std::move' explicitly to avoid copying
      return extras;
             ^~~~~~
             std::move(extras)

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/heartbeat.cc

index 139e684c092e2df15dec89ed90629d0f864808a1..2fdfe1abee5e6d19214eb194f39f5ac9d4dc43b2 100644 (file)
@@ -139,7 +139,7 @@ seastar::future<Heartbeat::osds_t> Heartbeat::remove_down_peers()
       if (extra >= 0) {
         extras.push_back(extra);
       }
-      return extras;
+      return std::move(extras);
     });
 }