From e4efe011d71b668537bc551996848e911de079ab Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sun, 29 Sep 2024 11:13:02 -0700 Subject: Modernize `std::max_element` with ranges and projections --- Source/Core/VideoCommon/TextureCacheBase.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp') diff --git a/Source/Core/VideoCommon/TextureCacheBase.cpp b/Source/Core/VideoCommon/TextureCacheBase.cpp index 70a753931a..57c07f7675 100644 --- a/Source/Core/VideoCommon/TextureCacheBase.cpp +++ b/Source/Core/VideoCommon/TextureCacheBase.cpp @@ -1665,11 +1665,8 @@ RcTcacheEntry TextureCacheBase::CreateTextureEntry( if (!assets_data.empty()) { const auto calculate_max_levels = [&]() { - const auto max_element = std::max_element( - assets_data.begin(), assets_data.end(), [](const auto& lhs, const auto& rhs) { - return lhs->m_texture.m_slices[0].m_levels.size() < - rhs->m_texture.m_slices[0].m_levels.size(); - }); + const auto max_element = std::ranges::max_element( + assets_data, {}, [](const auto& v) { return v->m_texture.m_slices[0].m_levels.size(); }); return (*max_element)->m_texture.m_slices[0].m_levels.size(); }; const u32 texLevels = no_mips ? 1 : (u32)calculate_max_levels(); -- cgit v1.2.3