From 140252ffc0ae71e8b5309bff7d6550189c602702 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:26:50 -0700 Subject: Modernize `std::any_of` with ranges In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates. --- Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp') diff --git a/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp b/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp index 4446f602e8..887875d2cb 100644 --- a/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp +++ b/Source/Core/VideoCommon/Assets/CustomAssetLibrary.cpp @@ -69,10 +69,8 @@ CustomAssetLibrary::LoadInfo CustomAssetLibrary::LoadGameTexture(const AssetID& } // All levels have to have the same format. - if (std::any_of(slice.m_levels.begin(), slice.m_levels.end(), - [&first_mip](const VideoCommon::CustomTextureData::ArraySlice::Level& l) { - return l.format != first_mip.format; - })) + if (std::ranges::any_of(slice.m_levels, + [&first_mip](const auto& l) { return l.format != first_mip.format; })) { ERROR_LOG_FMT( VIDEO, "Custom game texture {} has inconsistent formats across mip levels for slice {}.", -- cgit v1.2.3