From 469ed4a09f6b8596376ea44b8ea198ae2950df06 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 2 Aug 2018 12:45:56 -0400 Subject: [PATCH] kernel/vm_manager: Convert loop into std::any_of() --- src/core/hle/kernel/vm_manager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 79ad7a7429..e2891fdedf 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include #include #include "common/assert.h" #include "core/hle/kernel/errors.h" @@ -322,10 +323,9 @@ ResultVal VMManager::CarveVMARange(VAddr target, u32 size) { VMAIter begin_vma = StripIterConstness(FindVMA(target)); const VMAIter i_end = vma_map.lower_bound(target_end); - for (auto i = begin_vma; i != i_end; ++i) { - if (i->second.type == VMAType::Free) { - return ERR_INVALID_ADDRESS_STATE; - } + if (std::any_of(begin_vma, i_end, + [](const auto& entry) { return entry.second.type == VMAType::Free; })) { + return ERR_INVALID_ADDRESS_STATE; } if (target != begin_vma->second.base) {