diff options
Diffstat (limited to 'src')
| -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: | |||
| 524 | void MarkRegionAsWritten(VAddr start, VAddr end) { | 524 | void MarkRegionAsWritten(VAddr start, VAddr end) { |
| 525 | const u64 page_end = end >> WRITE_PAGE_BIT; | 525 | const u64 page_end = end >> WRITE_PAGE_BIT; |
| 526 | for (u64 page_start = start >> WRITE_PAGE_BIT; page_start <= page_end; ++page_start) { | 526 | for (u64 page_start = start >> WRITE_PAGE_BIT; page_start <= page_end; ++page_start) { |
| 527 | auto it = written_pages.find(page_start); | 527 | if (const auto [it, inserted] = written_pages.emplace(page_start, 1); !inserted) { |
| 528 | if (it != written_pages.end()) { | 528 | ++it->second; |
| 529 | it->second = it->second + 1; | ||
| 530 | } else { | ||
| 531 | written_pages.insert_or_assign(page_start, 1); | ||
| 532 | } | 529 | } |
| 533 | } | 530 | } |
| 534 | } | 531 | } |
| @@ -539,7 +536,7 @@ private: | |||
| 539 | auto it = written_pages.find(page_start); | 536 | auto it = written_pages.find(page_start); |
| 540 | if (it != written_pages.end()) { | 537 | if (it != written_pages.end()) { |
| 541 | if (it->second > 1) { | 538 | if (it->second > 1) { |
| 542 | it->second = it->second - 1; | 539 | --it->second; |
| 543 | } else { | 540 | } else { |
| 544 | written_pages.erase(it); | 541 | written_pages.erase(it); |
| 545 | } | 542 | } |