瀏覽代碼

async_shaders: Simplify implementation of GetCompletedWork()

This is equivalent to moving all the contents and then clearing the
vector. This avoids a redundant allocation.
Lioncash 5 年之前
父節點
當前提交
ba3916fc67
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/video_core/shader/async_shaders.cpp

+ 1 - 2
src/video_core/shader/async_shaders.cpp

@@ -106,8 +106,7 @@ std::vector<AsyncShaders::Result> AsyncShaders::GetCompletedWork() {
     std::vector<Result> 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;