From 208598dbe28a7b403660e97f8841d5f5f68c7dd2 Mon Sep 17 00:00:00 2001
From: Lioncash <mathew1800@gmail.com>
Date: Wed, 3 Dec 2014 19:55:45 -0500
Subject: kernel: Shorten GetCount

---
 src/core/hle/kernel/kernel.cpp | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

(limited to 'src/core/hle/kernel/kernel.cpp')

diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp
index 2954f9913c..80a34c2d50 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) {
-- 
cgit v1.2.3-70-g09d2