Avoid double-move
This was flagged by coverity but doesn't seem to be an actual issue in g++/clang. It technically leaves the moved rvalue in a "valid but undefined state", so it is best to avoid. The single copy into an lvalue is (I think) cheap
This commit is contained in:
parent
90ad4dcc05
commit
1b18e1eb6a
|
@ -393,8 +393,9 @@ public:
|
|||
blocks blks(first_index, index_after_last, num_blocks ? num_blocks : thread_count);
|
||||
if (blks.get_total_size() > 0)
|
||||
{
|
||||
F internal_loop = loop;
|
||||
for (size_t i = 0; i < blks.get_num_blocks(); ++i)
|
||||
push_task(std::forward<F>(loop), blks.start(i), blks.end(i));
|
||||
push_task(std::forward<F>(internal_loop), blks.start(i), blks.end(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue