diff options
| author | 2021-05-01 12:36:48 -0700 | |
|---|---|---|
| committer | 2021-05-05 16:40:53 -0700 | |
| commit | 51aa5a5364dffb7d8d278a66e69f190aef05c666 (patch) | |
| tree | e1cd710baace02649e417a198d7391bdd9468068 /src/core/hle/kernel | |
| parent | fixup! hle: kernel: Add initial impl. of KAutoObject. (diff) | |
| download | yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.gz yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.tar.xz yuzu-51aa5a5364dffb7d8d278a66e69f190aef05c666.zip | |
fixup! hle: kernel: Add initial impl. of KAutoObjectWithListContainer.
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/k_auto_object_container.cpp | 11 |
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) { | |||
| 21 | size_t KAutoObjectWithListContainer::GetOwnedCount(KProcess* owner) { | 21 | size_t KAutoObjectWithListContainer::GetOwnedCount(KProcess* owner) { |
| 22 | KScopedLightLock lk(m_lock); | 22 | KScopedLightLock lk(m_lock); |
| 23 | 23 | ||
| 24 | size_t count = 0; | 24 | return std::count_if(m_object_list.begin(), m_object_list.end(), |
| 25 | 25 | [&](const auto& obj) { return obj.GetOwner() == owner; }); | |
| 26 | for (auto& obj : m_object_list) { | ||
| 27 | if (obj.GetOwner() == owner) { | ||
| 28 | count++; | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | return count; | ||
| 33 | } | 26 | } |
| 34 | 27 | ||
| 35 | } // namespace Kernel | 28 | } // namespace Kernel |