summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Lioncash2020-11-20 04:44:42 -0500
committerGravatar Lioncash2020-11-20 04:44:44 -0500
commitba3916fc67bac5f9cb40ebc91fccca065e877174 (patch)
tree3967be53e9f380ba236843fe576754069666a2f7 /src
parentasync_shaders: Simplify moving data into the pending queue (diff)
downloadyuzu-ba3916fc67bac5f9cb40ebc91fccca065e877174.tar.gz
yuzu-ba3916fc67bac5f9cb40ebc91fccca065e877174.tar.xz
yuzu-ba3916fc67bac5f9cb40ebc91fccca065e877174.zip
async_shaders: Simplify implementation of GetCompletedWork()
This is equivalent to moving all the contents and then clearing the vector. This avoids a redundant allocation.
Diffstat (limited to '')
-rw-r--r--src/video_core/shader/async_shaders.cpp3
1 files changed, 1 insertions, 2 deletions
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::Result> AsyncShaders::GetCompletedWork() {
106 std::vector<Result> results; 106 std::vector<Result> results;
107 { 107 {
108 std::unique_lock lock{completed_mutex}; 108 std::unique_lock lock{completed_mutex};
109 results.assign(std::make_move_iterator(finished_work.begin()), 109 results = std::move(finished_work);
110 std::make_move_iterator(finished_work.end()));
111 finished_work.clear(); 110 finished_work.clear();
112 } 111 }
113 return results; 112 return results;