summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-02 18:45:56 +0200
committerLioncash <mathew1800@gmail.com>2018-08-02 18:46:15 +0200
commitd94a173877325b722ba27640acc9adea249b7c1c (patch)
tree077c3a08e14a1e044b0e84bcf95ab09cc89e50f1 /src/core/hle
parentkernel/vm_manager: Use const where applicable (diff)
downloadyuzu-d94a173877325b722ba27640acc9adea249b7c1c.tar
yuzu-d94a173877325b722ba27640acc9adea249b7c1c.tar.gz
yuzu-d94a173877325b722ba27640acc9adea249b7c1c.tar.bz2
yuzu-d94a173877325b722ba27640acc9adea249b7c1c.tar.lz
yuzu-d94a173877325b722ba27640acc9adea249b7c1c.tar.xz
yuzu-d94a173877325b722ba27640acc9adea249b7c1c.tar.zst
yuzu-d94a173877325b722ba27640acc9adea249b7c1c.zip
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/kernel/vm_manager.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp
index 0f89dd9f3..479cacb62 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 <algorithm>
#include <iterator>
#include <utility>
#include "common/assert.h"
@@ -295,10 +296,9 @@ ResultVal<VMManager::VMAIter> VMManager::CarveVMARange(VAddr target, u64 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) {