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
33f75fbd0a
commit
4a9994931a
|
@ -405,8 +405,9 @@ public:
|
||||||
blocks blks(first_index, index_after_last, num_blocks ? num_blocks : thread_count);
|
blocks blks(first_index, index_after_last, num_blocks ? num_blocks : thread_count);
|
||||||
if (blks.get_total_size() > 0)
|
if (blks.get_total_size() > 0)
|
||||||
{
|
{
|
||||||
|
F internal_loop = loop;
|
||||||
for (size_t i = 0; i < blks.get_num_blocks(); ++i)
|
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