mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-12-18 08:22:04 +00:00
sprofile: fix/simplify import count calculation
This commit is contained in:
parent
b06ada6ac8
commit
41e2c24101
1 changed files with 5 additions and 2 deletions
|
@ -68,13 +68,16 @@ namespace ams::sprofile::srv {
|
||||||
/* Import the service revision key. */
|
/* Import the service revision key. */
|
||||||
m_revision_key = meta.revision_key;
|
m_revision_key = meta.revision_key;
|
||||||
|
|
||||||
|
/* Set importing count. */
|
||||||
|
m_importing_count = static_cast<int>(std::min<size_t>(meta.num_entries, util::size(meta.entries)));
|
||||||
|
|
||||||
/* Set all profiles as importable. */
|
/* Set all profiles as importable. */
|
||||||
for (auto i = 0u; i < std::min<size_t>(meta.num_entries, util::size(meta.entries)); ++i) {
|
for (auto i = 0; i < m_importing_count; ++i) {
|
||||||
m_is_profile_importable[i] = true;
|
m_is_profile_importable[i] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine import status for all profiles. */
|
/* Determine import status for all profiles. */
|
||||||
for (auto i = 0u; i < std::min<size_t>(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 auto &import_entry = meta.entries[i];
|
||||||
|
|
||||||
const bool is_new_import = !this->HasProfile(import_entry.identifier_0, import_entry.identifier_1);
|
const bool is_new_import = !this->HasProfile(import_entry.identifier_0, import_entry.identifier_1);
|
||||||
|
|
Loading…
Reference in a new issue