From 662218e997de83fdcc7250f2348a750b1e5b3a51 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Sat, 11 Aug 2018 20:15:59 +1000 Subject: Removed all for loops from the profile manager --- src/core/hle/service/acc/profile_manager.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/core/hle') diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 8f3dab6a0..ef793b311 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -141,20 +141,15 @@ void ProfileManager::CloseUser(UUID uuid) { std::array ProfileManager::GetAllUsers() const { std::array output; - for (unsigned i = 0; i < user_count; i++) { - output[i] = profiles[i].user_uuid; - } + std::transform(profiles.begin(), profiles.end(), output.begin(), + [](const ProfileInfo& p) { return p.user_uuid; }); return output; } std::array ProfileManager::GetOpenUsers() const { std::array output; - unsigned user_idx = 0; - for (unsigned i = 0; i < user_count; i++) { - if (profiles[i].is_open) { - output[i++] = profiles[i].user_uuid; - } - } + std::copy_if(profiles.begin(), profiles.end(), output.begin(), + [](const ProfileInfo& p) { return p.is_open; }); return output; } -- cgit v1.2.3