From ba3916fc67bac5f9cb40ebc91fccca065e877174 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 20 Nov 2020 04:44:42 -0500 Subject: async_shaders: Simplify implementation of GetCompletedWork() This is equivalent to moving all the contents and then clearing the vector. This avoids a redundant allocation. --- src/video_core/shader/async_shaders.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/video_core') diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp index c6bd75b7c..85cda31c0 100644 --- a/src/video_core/shader/async_shaders.cpp +++ b/src/video_core/shader/async_shaders.cpp @@ -106,8 +106,7 @@ std::vector AsyncShaders::GetCompletedWork() { std::vector results; { std::unique_lock lock{completed_mutex}; - results.assign(std::make_move_iterator(finished_work.begin()), - std::make_move_iterator(finished_work.end())); + results = std::move(finished_work); finished_work.clear(); } return results; -- cgit v1.2.3