summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-12-04 01:55:45 +0100
committerLioncash <mathew1800@gmail.com>2014-12-04 04:52:02 +0100
commit208598dbe28a7b403660e97f8841d5f5f68c7dd2 (patch)
tree12f2fa3e83c0bf7b7768a15b63dfdd3f70fed9e8
parentkernel: Make some functions const (diff)
downloadyuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar
yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.gz
yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.bz2
yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.lz
yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.xz
yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.zst
yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.zip
-rw-r--r--src/core/hle/kernel/kernel.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 2954f9913..80a34c2d5 100644
--- a/src/core/hle/kernel/kernel.cpp
+++ b/src/core/hle/kernel/kernel.cpp
@@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
+#include <algorithm>
+
#include "common/common.h"
#include "core/core.h"
@@ -76,12 +78,7 @@ void ObjectPool::List() {
}
int ObjectPool::GetCount() const {
- int count = 0;
- for (int i = 0; i < MAX_COUNT; i++) {
- if (occupied[i])
- count++;
- }
- return count;
+ return std::count(occupied.begin(), occupied.end(), true);
}
Object* ObjectPool::CreateByIDType(int type) {