mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-03 01:38:36 +00:00
Modernize std::max_element
with ranges and projections
This commit is contained in:
parent
258ec4f9cd
commit
e4efe011d7
2 changed files with 3 additions and 8 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue