From: Arnaud Giersch Date: Fri, 2 Oct 2020 20:04:16 +0000 (+0200) Subject: [sonar] Don't take shared_ptr by rvalue reference. X-Git-Tag: v3.26~405 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6ef167a6a1f8f26057bb63c40f5fee0622e8353d [sonar] Don't take shared_ptr by rvalue reference. --- diff --git a/include/simgrid/simix/blocking_simcall.hpp b/include/simgrid/simix/blocking_simcall.hpp index e524ec5d8c..2bccf68dfb 100644 --- a/include/simgrid/simix/blocking_simcall.hpp +++ b/include/simgrid/simix/blocking_simcall.hpp @@ -56,7 +56,7 @@ template auto kernel_sync(F code) -> decltype(code().get()) [&result, self, &code] { try { auto future = code(); - future.then_([&result, self](std::shared_ptr>&& value) { + future.then_([&result, self](std::shared_ptr> value) { simgrid::xbt::set_promise(result, simgrid::kernel::Future(std::move(value))); simgrid::simix::unblock(self); }); @@ -94,7 +94,7 @@ public: [this, &result, self] { try { // When the kernel future is ready... - this->future_.then_([&result, self](std::shared_ptr>&& value) { + this->future_.then_([&result, self](std::shared_ptr> value) { // ... wake up the process with the result of the kernel future. simgrid::xbt::set_promise(result, simgrid::kernel::Future(std::move(value))); simgrid::simix::unblock(self); @@ -125,7 +125,7 @@ public: [this, &exception, self] { try { // When the kernel future is ready... - this->future_.then_([this, self](std::shared_ptr>&& value) { + this->future_.then_([this, self](std::shared_ptr> value) { // ...store it the simix kernel and wake up. this->future_ = simgrid::kernel::Future(std::move(value)); simgrid::simix::unblock(self);