summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Marcec <dmarcecguzman@gmail.com>2018-08-11 12:15:59 +0200
committerDavid Marcec <dmarcecguzman@gmail.com>2018-08-11 12:15:59 +0200
commit662218e997de83fdcc7250f2348a750b1e5b3a51 (patch)
treeae4be9b72f98abf579e8ff334588e28948b39093
parentAdded missing ListAllUsers count (diff)
downloadyuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.gz
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.bz2
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.lz
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.xz
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.zst
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.zip
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp13
1 files changed, 4 insertions, 9 deletions
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<UUID, MAX_USERS> ProfileManager::GetAllUsers() const {
std::array<UUID, MAX_USERS> 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<UUID, MAX_USERS> ProfileManager::GetOpenUsers() const {
std::array<UUID, MAX_USERS> 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;
}