Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics: fix "Malformed whitespace in C++" spotted by codefactor.io.
[simgrid.git] / include / simgrid / simix / blocking_simcall.hpp
index 017b7f2..c4d550d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2016-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -57,7 +57,7 @@ template <class F> auto kernel_sync(F code) -> decltype(code().get())
         try {
           auto future = code();
           future.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
-            simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
+            simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(std::move(value)));
             simgrid::simix::unblock(self);
           });
         } catch (...) {
@@ -94,7 +94,7 @@ public:
             // When the kernel future is ready...
             this->future_.then_([&result, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
               // ... wake up the process with the result of the kernel future.
-              simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(value));
+              simgrid::xbt::set_promise(result, simgrid::kernel::Future<T>(std::move(value)));
               simgrid::simix::unblock(self);
             });
           } catch (...) {
@@ -125,7 +125,7 @@ public:
             // When the kernel future is ready...
             this->future_.then_([this, self](std::shared_ptr<simgrid::kernel::FutureState<T>>&& value) {
               // ...store it the simix kernel and wake up.
-              this->future_ = std::move(simgrid::kernel::Future<T>(value));
+              this->future_ = simgrid::kernel::Future<T>(std::move(value));
               simgrid::simix::unblock(self);
             });
           } catch (...) {
@@ -135,6 +135,7 @@ public:
         },
         nullptr);
   }
+
 private:
   // We wrap an event-based kernel future:
   simgrid::kernel::Future<T> future_;