Skip to content

Commit

Permalink
Remove unnecessary std::forward
Browse files Browse the repository at this point in the history
  • Loading branch information
alugowski committed Jan 24, 2024
1 parent 091214d commit 5cf834a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions include/poolstl/internal/thread_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ namespace poolstl {
auto iter_chunk_size = get_iter_chunk_size(first, last, chunk_size);
RandIt loop_end = advanced(first, iter_chunk_size);

threads.emplace_back(std::thread(std::forward<Chunk>(chunk), first, loop_end,
std::forward<A>(chunk_args)...));
threads.emplace_back(std::thread(chunk, first, loop_end, chunk_args...));

first = loop_end;
}
Expand Down
14 changes: 5 additions & 9 deletions include/poolstl/internal/ttp_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace poolstl {
auto iter_chunk_size = get_iter_chunk_size(first, last, chunk_size);
RandIt loop_end = advanced(first, iter_chunk_size);

futures.emplace_back(task_pool.submit(std::forward<Chunk>(chunk), first, loop_end));
futures.emplace_back(task_pool.submit(chunk, first, loop_end));

first = loop_end;
}
Expand All @@ -79,8 +79,7 @@ namespace poolstl {
auto iter_chunk_size = get_iter_chunk_size(first, last, chunk_size);
RandIt loop_end = advanced(first, iter_chunk_size);

futures.emplace_back(task_pool.submit(std::forward<Chunk>(chunk), first, loop_end,
std::forward<A>(chunk_args)...));
futures.emplace_back(task_pool.submit(chunk, first, loop_end, chunk_args...));

first = loop_end;
}
Expand All @@ -96,8 +95,7 @@ namespace poolstl {
parallel_chunk_for_1_wait(ExecPolicy &&policy, RandIt first, RandIt last,
Chunk chunk, ChunkRet* rettype, int extra_split_factor, A&&... chunk_args) {
auto futures = parallel_chunk_for_1(std::forward<ExecPolicy>(policy), first, last,
std::forward<Chunk>(chunk), rettype, extra_split_factor,
std::forward<A>(chunk_args)...);
chunk, rettype, extra_split_factor, chunk_args...);
get_futures(futures);
}

Expand All @@ -116,8 +114,7 @@ namespace poolstl {
auto iter_chunk_size = get_iter_chunk_size(first1, last1, chunk_size);
RandIt1 loop_end = advanced(first1, iter_chunk_size);

futures.emplace_back(task_pool.submit(std::forward<Chunk>(chunk), first1, loop_end, first2,
std::forward<A>(chunk_args)...));
futures.emplace_back(task_pool.submit(chunk, first1, loop_end, first2, chunk_args...));

first1 = loop_end;
std::advance(first2, iter_chunk_size);
Expand All @@ -142,8 +139,7 @@ namespace poolstl {
auto iter_chunk_size = get_iter_chunk_size(first1, last1, chunk_size);
RandIt1 loop_end = advanced(first1, iter_chunk_size);

futures.emplace_back(task_pool.submit(std::forward<Chunk>(chunk), first1, loop_end, first2, first3,
std::forward<A>(chunk_args)...));
futures.emplace_back(task_pool.submit(chunk, first1, loop_end, first2, first3, chunk_args...));

first1 = loop_end;
std::advance(first2, iter_chunk_size);
Expand Down

0 comments on commit 5cf834a

Please sign in to comment.