From 24fe8d5351fc7b9faa7f2556b3857365b9d9e438 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Tue, 9 Jan 2024 01:07:32 -0500 Subject: [PATCH] Remove a pessimizing move (#4202) When compiling Fast-DDS with clang, it shows a warning that the use of std::move in FileWatch.hpp is pessimizing. Remove the unnecessary std::move here, which fixes the warning. Signed-off-by: Chris Lalancette (cherry picked from commit b28171b0223996888f3773d20c51aed94a561d32) --- thirdparty/filewatch/FileWatch.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thirdparty/filewatch/FileWatch.hpp b/thirdparty/filewatch/FileWatch.hpp index b2909226f0e..3b485d8d038 100644 --- a/thirdparty/filewatch/FileWatch.hpp +++ b/thirdparty/filewatch/FileWatch.hpp @@ -207,7 +207,7 @@ namespace filewatch { throw std::system_error(GetLastError(), std::system_category()); } #endif // WIN32 - _callback_thread = std::move(std::thread([this]() { + _callback_thread = std::thread([this]() { try { callback_thread(); } catch (...) { @@ -216,8 +216,8 @@ namespace filewatch { } catch (...) {} // set_exception() may throw too } - })); - _watch_thread = std::move(std::thread([this]() { + }); + _watch_thread = std::thread([this]() { try { monitor_directory(); } catch (...) { @@ -226,7 +226,7 @@ namespace filewatch { } catch (...) {} // set_exception() may throw too } - })); + }); std::future future = _running.get_future(); future.get(); //block until the monitor_directory is up and running