summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2018-08-11 20:15:59 +1000
committerGravatar David Marcec2018-08-11 20:15:59 +1000
commit662218e997de83fdcc7250f2348a750b1e5b3a51 (patch)
treeae4be9b72f98abf579e8ff334588e28948b39093 /src
parentAdded missing ListAllUsers count (diff)
downloadyuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.gz
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.tar.xz
yuzu-662218e997de83fdcc7250f2348a750b1e5b3a51.zip
Removed all for loops from the profile manager
Diffstat (limited to 'src')
-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) {
141 141
142std::array<UUID, MAX_USERS> ProfileManager::GetAllUsers() const { 142std::array<UUID, MAX_USERS> ProfileManager::GetAllUsers() const {
143 std::array<UUID, MAX_USERS> output; 143 std::array<UUID, MAX_USERS> output;
144 for (unsigned i = 0; i < user_count; i++) { 144 std::transform(profiles.begin(), profiles.end(), output.begin(),
145 output[i] = profiles[i].user_uuid; 145 [](const ProfileInfo& p) { return p.user_uuid; });
146 }
147 return output; 146 return output;
148} 147}
149 148
150std::array<UUID, MAX_USERS> ProfileManager::GetOpenUsers() const { 149std::array<UUID, MAX_USERS> ProfileManager::GetOpenUsers() const {
151 std::array<UUID, MAX_USERS> output; 150 std::array<UUID, MAX_USERS> output;
152 unsigned user_idx = 0; 151 std::copy_if(profiles.begin(), profiles.end(), output.begin(),
153 for (unsigned i = 0; i < user_count; i++) { 152 [](const ProfileInfo& p) { return p.is_open; });
154 if (profiles[i].is_open) {
155 output[i++] = profiles[i].user_uuid;
156 }
157 }
158 return output; 153 return output;
159} 154}
160 155