CLogBookScreen: Make use of std::any_of within IsScanCategoryReady()

Same thing but collapses into a single return.
This commit is contained in:
Lioncash 2019-10-15 10:00:10 -04:00
parent 251a2a7723
commit d64824d3e5
1 changed files with 11 additions and 8 deletions

View File

@ -159,16 +159,19 @@ void CLogBookScreen::PumpArticleLoad() {
} }
bool CLogBookScreen::IsScanCategoryReady(CSaveWorld::EScanCategory category) const { bool CLogBookScreen::IsScanCategoryReady(CSaveWorld::EScanCategory category) const {
CPlayerState& playerState = *x4_mgr.GetPlayerState(); const CPlayerState& playerState = *x4_mgr.GetPlayerState();
for (const std::pair<CAssetId, CSaveWorld::EScanCategory>& scanState : g_MemoryCardSys->GetScanStates()) { const auto& scanState = g_MemoryCardSys->GetScanStates();
if (scanState.second != category)
continue; return std::any_of(scanState.cbegin(), scanState.cend(), [category, &playerState](const auto& state) {
if (IsScanComplete(scanState.second, scanState.first, playerState)) if (state.second != category) {
return true;
}
return false; return false;
}
return IsScanComplete(state.second, state.first, playerState);
});
} }
void CLogBookScreen::UpdateBodyText() { void CLogBookScreen::UpdateBodyText() {
if (x10_mode != EMode::TextScroll) { if (x10_mode != EMode::TextScroll) {
x174_textpane_body->TextSupport().SetText(u""); x174_textpane_body->TextSupport().SetText(u"");