summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/TextureCacheBase.cpp
diff options
context:
space:
mode:
authormitaclaw <140017135+mitaclaw@users.noreply.github.com>2024-09-29 11:13:02 -0700
committermitaclaw <140017135+mitaclaw@users.noreply.github.com>2025-03-09 13:26:39 -0700
commite4efe011d71b668537bc551996848e911de079ab (patch)
tree0fd4dbeae1db72c7963b827dc9d4d2fdab93d285 /Source/Core/VideoCommon/TextureCacheBase.cpp
parent258ec4f9cd77759677184495d31f25c72e9afa22 (diff)
Modernize `std::max_element` with ranges and projections
Diffstat (limited to 'Source/Core/VideoCommon/TextureCacheBase.cpp')
-rw-r--r--Source/Core/VideoCommon/TextureCacheBase.cpp7
1 files changed, 2 insertions, 5 deletions
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();