diff options
author | bunnei <bunneidev@gmail.com> | 2020-10-21 04:07:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-21 04:07:39 +0200 |
commit | 3d592972dc3fd61cc88771b889eff237e4e03e0f (patch) | |
tree | 0dbc65ac86e609ae22087c7be9d4759ac6b73004 /src/core/hle/service/acc/profile_manager.cpp | |
parent | kernel: Fix build with recent compiler flag changes (diff) | |
download | yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.gz yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.bz2 yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.lz yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.xz yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.tar.zst yuzu-3d592972dc3fd61cc88771b889eff237e4e03e0f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/acc/profile_manager.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 9c302043a..9b829e957 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp @@ -41,15 +41,12 @@ constexpr char ACC_SAVE_AVATORS_BASE_PATH[] = "/system/save/8000000000000010/su/ ProfileManager::ProfileManager() { ParseUserSaveFile(); - if (user_count == 0) { + if (user_count == 0) CreateNewUser(UUID::Generate(), "yuzu"); - } - auto current = static_cast<size_t>( - std::clamp(Settings::values.current_user, 0, static_cast<s32>(MAX_USERS - 1))); - if (UserExistsIndex(current)) { + auto current = std::clamp<int>(Settings::values.current_user, 0, MAX_USERS - 1); + if (UserExistsIndex(current)) current = 0; - } OpenUser(*GetUser(current)); } @@ -192,8 +189,8 @@ std::size_t ProfileManager::GetUserCount() const { /// booting std::size_t ProfileManager::GetOpenUserCount() const { - return static_cast<std::size_t>(std::count_if(profiles.begin(), profiles.end(), - [](const ProfileInfo& p) { return p.is_open; })); + return std::count_if(profiles.begin(), profiles.end(), + [](const ProfileInfo& p) { return p.is_open; }); } /// Checks if a user id exists in our profile manager |