diff options
author | Lioncash <mathew1800@gmail.com> | 2020-07-20 23:40:04 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-07-20 23:48:00 +0200 |
commit | 26c6c71837728f8348602474f2dc884a1da0664e (patch) | |
tree | bafb61af6a4b7f6093d65ac650ab946d9fa537af /src/video_core | |
parent | Merge pull request #4376 from ogniK5377/dark-wait-tree (diff) | |
download | yuzu-26c6c71837728f8348602474f2dc884a1da0664e.tar yuzu-26c6c71837728f8348602474f2dc884a1da0664e.tar.gz yuzu-26c6c71837728f8348602474f2dc884a1da0664e.tar.bz2 yuzu-26c6c71837728f8348602474f2dc884a1da0664e.tar.lz yuzu-26c6c71837728f8348602474f2dc884a1da0664e.tar.xz yuzu-26c6c71837728f8348602474f2dc884a1da0664e.tar.zst yuzu-26c6c71837728f8348602474f2dc884a1da0664e.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index dd7ce8c99..b5dc68902 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -524,11 +524,8 @@ private: void MarkRegionAsWritten(VAddr start, VAddr end) { const u64 page_end = end >> WRITE_PAGE_BIT; for (u64 page_start = start >> WRITE_PAGE_BIT; page_start <= page_end; ++page_start) { - auto it = written_pages.find(page_start); - if (it != written_pages.end()) { - it->second = it->second + 1; - } else { - written_pages.insert_or_assign(page_start, 1); + if (const auto [it, inserted] = written_pages.emplace(page_start, 1); !inserted) { + ++it->second; } } } @@ -539,7 +536,7 @@ private: auto it = written_pages.find(page_start); if (it != written_pages.end()) { if (it->second > 1) { - it->second = it->second - 1; + --it->second; } else { written_pages.erase(it); } |