]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: removing a "pessimizing move" 37958/head
authorRonen Friedman <rfriedma@redhat.com>
Thu, 5 Nov 2020 08:38:37 +0000 (10:38 +0200)
committerRonen Friedman <rfriedma@redhat.com>
Thu, 5 Nov 2020 16:46:46 +0000 (18:46 +0200)
Silencing a compiler warning ("warning: moving a temporary object
prevents copy elision")

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/librbd/cache/ObjectCacherObjectDispatch.cc

index 2fefb26af73b1b8df8165502caf7d0aff3d85c37..81d5a71885b01d6cd100e93f212366ab56d76c6b 100644 (file)
@@ -326,9 +326,9 @@ bool ObjectCacherObjectDispatch<I>::write(
   SnapContext snapc;
   if (io_context->write_snap_context()) {
     auto write_snap_context = *io_context->write_snap_context();
-    snapc = std::move(SnapContext(write_snap_context.first,
-                                  {write_snap_context.second.begin(),
-                                   write_snap_context.second.end()}));
+    snapc = SnapContext(write_snap_context.first,
+                        {write_snap_context.second.begin(),
+                         write_snap_context.second.end()});
   }
 
   m_image_ctx->image_lock.lock_shared();