mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-28 01:52:29 -06:00
kernel/vm_manager: Convert loop into std::any_of()
This commit is contained in:
parent
c7e1dab45b
commit
469ed4a09f
1 changed files with 4 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under GPLv2 or any later version
|
// Licensed under GPLv2 or any later version
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "core/hle/kernel/errors.h"
|
#include "core/hle/kernel/errors.h"
|
||||||
|
@ -322,10 +323,9 @@ ResultVal<VMManager::VMAIter> VMManager::CarveVMARange(VAddr target, u32 size) {
|
||||||
|
|
||||||
VMAIter begin_vma = StripIterConstness(FindVMA(target));
|
VMAIter begin_vma = StripIterConstness(FindVMA(target));
|
||||||
const VMAIter i_end = vma_map.lower_bound(target_end);
|
const VMAIter i_end = vma_map.lower_bound(target_end);
|
||||||
for (auto i = begin_vma; i != i_end; ++i) {
|
if (std::any_of(begin_vma, i_end,
|
||||||
if (i->second.type == VMAType::Free) {
|
[](const auto& entry) { return entry.second.type == VMAType::Free; })) {
|
||||||
return ERR_INVALID_ADDRESS_STATE;
|
return ERR_INVALID_ADDRESS_STATE;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target != begin_vma->second.base) {
|
if (target != begin_vma->second.base) {
|
||||||
|
|
Loading…
Reference in a new issue