diff options
| author | 2014-12-03 19:55:45 -0500 | |
|---|---|---|
| committer | 2014-12-03 22:52:02 -0500 | |
| commit | 208598dbe28a7b403660e97f8841d5f5f68c7dd2 (patch) | |
| tree | 12f2fa3e83c0bf7b7768a15b63dfdd3f70fed9e8 /src/core/hle/kernel/kernel.cpp | |
| parent | kernel: Make some functions const (diff) | |
| download | yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.gz yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.tar.xz yuzu-208598dbe28a7b403660e97f8841d5f5f68c7dd2.zip | |
kernel: Shorten GetCount
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
| -rw-r--r-- | src/core/hle/kernel/kernel.cpp | 9 |
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 @@ | |||
| 2 | // Licensed under GPLv2 | 2 | // Licensed under GPLv2 |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | |||
| 5 | #include "common/common.h" | 7 | #include "common/common.h" |
| 6 | 8 | ||
| 7 | #include "core/core.h" | 9 | #include "core/core.h" |
| @@ -76,12 +78,7 @@ void ObjectPool::List() { | |||
| 76 | } | 78 | } |
| 77 | 79 | ||
| 78 | int ObjectPool::GetCount() const { | 80 | int ObjectPool::GetCount() const { |
| 79 | int count = 0; | 81 | return std::count(occupied.begin(), occupied.end(), true); |
| 80 | for (int i = 0; i < MAX_COUNT; i++) { | ||
| 81 | if (occupied[i]) | ||
| 82 | count++; | ||
| 83 | } | ||
| 84 | return count; | ||
| 85 | } | 82 | } |
| 86 | 83 | ||
| 87 | Object* ObjectPool::CreateByIDType(int type) { | 84 | Object* ObjectPool::CreateByIDType(int type) { |