Skip to content

Commit

Permalink
improve use of emplace_back
Browse files Browse the repository at this point in the history
- avoid std::move on temporary (fixes clang warning)
- avoid creating temporary std::thread
  • Loading branch information
svigerske committed Oct 24, 2024
1 parent 15bc68e commit df38b5c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/parallel/HighsTaskExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ class HighsTaskExecutor {

for (int i = 1, numThreads = static_cast<int>(workerDeques.size());
i < numThreads; ++i) {
workerThreads.emplace_back(
std::move(std::thread(&HighsTaskExecutor::run_worker, i, this)));
workerThreads.emplace_back(&HighsTaskExecutor::run_worker, i, this);
}
}

Expand Down

0 comments on commit df38b5c

Please sign in to comment.