Merge pull request #13090 from mitaclaw/ranges-modernization-1-trivial

Ranges Algorithms Modernization - Trivial
This commit is contained in:
JosJuice
2024-10-15 17:08:55 +02:00
committed by GitHub
52 changed files with 106 additions and 118 deletions

View File

@ -151,7 +151,7 @@ ScissorResult::ScissorResult(const BPMemory& bpmemory, std::pair<float, float> v
}
auto cmp = [&](const ScissorRect& lhs, const ScissorRect& rhs) { return IsWorse(lhs, rhs); };
std::sort(m_result.begin(), m_result.end(), cmp);
std::ranges::sort(m_result, cmp);
}
ScissorRect ScissorResult::Best() const

View File

@ -764,9 +764,9 @@ bool FramebufferManager::CreateReadbackFramebuffer()
}
m_efb_color_cache.tiles.resize(total_tiles);
std::fill(m_efb_color_cache.tiles.begin(), m_efb_color_cache.tiles.end(), EFBCacheTile{false, 0});
std::ranges::fill(m_efb_color_cache.tiles, EFBCacheTile{false, 0});
m_efb_depth_cache.tiles.resize(total_tiles);
std::fill(m_efb_depth_cache.tiles.begin(), m_efb_depth_cache.tiles.end(), EFBCacheTile{false, 0});
std::ranges::fill(m_efb_depth_cache.tiles, EFBCacheTile{false, 0});
return true;
}

View File

@ -965,8 +965,7 @@ void VertexManagerBase::OnDraw()
// Check if this draw is scheduled to kick a command buffer.
// The draw counters will always be sorted so a binary search is possible here.
if (std::binary_search(m_scheduled_command_buffer_kicks.begin(),
m_scheduled_command_buffer_kicks.end(), m_draw_counter))
if (std::ranges::binary_search(m_scheduled_command_buffer_kicks, m_draw_counter))
{
// Kick a command buffer on the background thread.
g_gfx->Flush();