summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-05-01 21:36:48 +0200
committerbunnei <bunneidev@gmail.com>2021-05-06 01:40:53 +0200
commit51aa5a5364dffb7d8d278a66e69f190aef05c666 (patch)
treee1cd710baace02649e417a198d7391bdd9468068 /src
parentfixup! hle: kernel: Add initial impl. of KAutoObject. (diff)
downloadyuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar
yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.gz
yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.bz2
yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.lz
yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.xz
yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.zst
yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/k_auto_object_container.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/core/hle/kernel/k_auto_object_container.cpp b/src/core/hle/kernel/k_auto_object_container.cpp
index 85d03ebe3..fc0c28874 100644
--- a/src/core/hle/kernel/k_auto_object_container.cpp
+++ b/src/core/hle/kernel/k_auto_object_container.cpp
@@ -21,15 +21,8 @@ void KAutoObjectWithListContainer::Unregister(KAutoObjectWithList* obj) {
size_t KAutoObjectWithListContainer::GetOwnedCount(KProcess* owner) {
KScopedLightLock lk(m_lock);
- size_t count = 0;
-
- for (auto& obj : m_object_list) {
- if (obj.GetOwner() == owner) {
- count++;
- }
- }
-
- return count;
+ return std::count_if(m_object_list.begin(), m_object_list.end(),
+ [&](const auto& obj) { return obj.GetOwner() == owner; });
}
} // namespace Kernel