diff options
| author | Feng Chen <vonchenplus@gmail.com> | 2021-12-03 12:31:07 +0800 |
|---|---|---|
| committer | vonchenplus <vonchenplus@gmail.com> | 2021-12-05 00:06:14 +0800 |
| commit | 4a3c1192b81d45f454b422b4f07a6cae52a494c6 (patch) | |
| tree | e054071cd06fd36a0ca03478e168cb866a057b15 /src/video_core/gpu.cpp | |
| parent | 10cc89bfdf3b9f05f731859e7a35b0541e523f2e (diff) | |
Address feedback
Diffstat (limited to 'src/video_core/gpu.cpp')
| -rw-r--r-- | src/video_core/gpu.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 27a47954d0..8788f5148f 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp @@ -333,8 +333,8 @@ struct GPU::Impl { return; } - if (cdma_pushers.find(id) == cdma_pushers.end()) { - cdma_pushers[id] = std::make_unique<Tegra::CDmaPusher>(gpu); + if (!cdma_pushers.contains(id)) { + cdma_pushers.insert_or_assign(id, std::make_unique<Tegra::CDmaPusher>(gpu)); } // SubmitCommandBuffer would make the nvdec operations async, this is not currently working @@ -345,8 +345,9 @@ struct GPU::Impl { /// Frees the CDMAPusher instance to free up resources void ClearCdmaInstance(u32 id) { - if (cdma_pushers.find(id) != cdma_pushers.end()) { - cdma_pushers.erase(id); + const auto iter = cdma_pushers.find(id); + if (iter != cdma_pushers.end()) { + cdma_pushers.erase(iter); } } |
