Skip to content

Commit

Permalink
Remove a pessimizing move (#4202)
Browse files Browse the repository at this point in the history
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 <clalancette@gmail.com>
(cherry picked from commit b28171b)
  • Loading branch information
clalancette authored and mergify[bot] committed Jan 9, 2024
1 parent 6f6091a commit 24fe8d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions thirdparty/filewatch/FileWatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 (...) {
Expand All @@ -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 (...) {
Expand All @@ -226,7 +226,7 @@ namespace filewatch {
}
catch (...) {} // set_exception() may throw too
}
}));
});

std::future<void> future = _running.get_future();
future.get(); //block until the monitor_directory is up and running
Expand Down

0 comments on commit 24fe8d5

Please sign in to comment.