mirror of
https://git.h3cjp.net/H3cJP/yuzu.git
synced 2024-11-16 00:33:05 +00:00
async_shaders: Simplify implementation of GetCompletedWork()
This is equivalent to moving all the contents and then clearing the vector. This avoids a redundant allocation.
This commit is contained in:
parent
3fcc98e11a
commit
ba3916fc67
|
@ -106,8 +106,7 @@ std::vector<AsyncShaders::Result> AsyncShaders::GetCompletedWork() {
|
||||||
std::vector<Result> results;
|
std::vector<Result> results;
|
||||||
{
|
{
|
||||||
std::unique_lock lock{completed_mutex};
|
std::unique_lock lock{completed_mutex};
|
||||||
results.assign(std::make_move_iterator(finished_work.begin()),
|
results = std::move(finished_work);
|
||||||
std::make_move_iterator(finished_work.end()));
|
|
||||||
finished_work.clear();
|
finished_work.clear();
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
|
|
Loading…
Reference in a new issue