From 41e2c241018b95db54f8a20d089c836fabf9f8d9 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 22 Mar 2022 01:00:53 -0700 Subject: [PATCH] sprofile: fix/simplify import count calculation --- .../source/sprofile/srv/sprofile_srv_profile_importer.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/libstratosphere/source/sprofile/srv/sprofile_srv_profile_importer.hpp b/libraries/libstratosphere/source/sprofile/srv/sprofile_srv_profile_importer.hpp index 94a91e796..20df0fbe2 100644 --- a/libraries/libstratosphere/source/sprofile/srv/sprofile_srv_profile_importer.hpp +++ b/libraries/libstratosphere/source/sprofile/srv/sprofile_srv_profile_importer.hpp @@ -68,13 +68,16 @@ namespace ams::sprofile::srv { /* Import the service revision key. */ m_revision_key = meta.revision_key; + /* Set importing count. */ + m_importing_count = static_cast(std::min(meta.num_entries, util::size(meta.entries))); + /* Set all profiles as importable. */ - for (auto i = 0u; i < std::min(meta.num_entries, util::size(meta.entries)); ++i) { + for (auto i = 0; i < m_importing_count; ++i) { m_is_profile_importable[i] = true; } /* Determine import status for all profiles. */ - for (auto i = 0u; i < std::min(meta.num_entries, util::size(meta.entries)); ++i) { + for (auto i = 0; i < m_importing_count; ++i) { const auto &import_entry = meta.entries[i]; const bool is_new_import = !this->HasProfile(import_entry.identifier_0, import_entry.identifier_1);