diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index ef4976bfe..01d521121 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -707,7 +707,7 @@ void ReplayFileList::Refresh() { // OFFSET: 0x00B84300 // FUNCTION: fn_19313 const char* ReplayFileList::FileName(int index) const { - if (static_cast(index) >= this->files.size()) { + if (this->files.size() <= static_cast(index)) { return nullptr; } diff --git a/Source/Client/Session.cpp b/Source/Client/Session.cpp index db65c039e..344e1f29b 100644 --- a/Source/Client/Session.cpp +++ b/Source/Client/Session.cpp @@ -2442,7 +2442,7 @@ bool CSession::HasItem1740Number(int value) const { // FUNCTION: fn_23574 bool CSession::HasUnknown809C(std::string name) { for (std::vector::iterator it = this->characterNames.begin(); it != this->characterNames.end(); ++it) { - if (*it == name) { + if (name == *it) { return true; } } diff --git a/Source/Contents/CashEmotionMgr.cpp b/Source/Contents/CashEmotionMgr.cpp index 9fa62b887..a705adc3c 100644 --- a/Source/Contents/CashEmotionMgr.cpp +++ b/Source/Contents/CashEmotionMgr.cpp @@ -1943,7 +1943,7 @@ void UICashEmotionListChildWnd_Purchase::UpdateExpiry(int packId, Timestamp* exp } } - if (it != this->m_items.end()) { + if (this->m_items.end() != it) { (*it)->UpdateExpiry(expiry); } } diff --git a/Source/Contents/EffectResourceSwitcher.cpp b/Source/Contents/EffectResourceSwitcher.cpp index 61072aa64..117e2b76d 100644 --- a/Source/Contents/EffectResourceSwitcher.cpp +++ b/Source/Contents/EffectResourceSwitcher.cpp @@ -529,11 +529,12 @@ void CEZ2STREffectMgr::InfoInserter::operator()(const std::paireffects.begin(); - while (it != this->effects.end() && id != it->second.id + 10000) { + const auto end = this->effects.end(); + while (it != end && id != it->second.id + 10000) { ++it; } - return it != this->effects.end() ? &it->second : nullptr; + return it != end ? &it->second : nullptr; } // OFFSET: 0x00700A90 diff --git a/Source/Contents/RenewQuestMgr.cpp b/Source/Contents/RenewQuestMgr.cpp index a9011da73..bb9b7f3d2 100644 --- a/Source/Contents/RenewQuestMgr.cpp +++ b/Source/Contents/RenewQuestMgr.cpp @@ -178,7 +178,7 @@ void CRenewQuestMgr::RemoveStatusRequest(unsigned int id) { // OFFSET: 0x00677D80 // FUNCTION: fn_05438 std::string RenewQuestOngoingInfo::GetDateString() const { - return this->m_year > 1970 ? std::format("{0} [{1:04}/{2:02}/{3:02} {4:02}:{5:02}]", LookupMessage(MSI_NAVIGATION_ROUTEINFO), this->m_year, + return 1970 < this->m_year ? std::format("{0} [{1:04}/{2:02}/{3:02} {4:02}:{5:02}]", LookupMessage(MSI_NAVIGATION_ROUTEINFO), this->m_year, this->m_month, this->m_day, this->m_hour, this->m_minute) : std::string(""); } diff --git a/Source/Contents/ReputeMgr.cpp b/Source/Contents/ReputeMgr.cpp index c0d44f1d7..a89353d54 100644 --- a/Source/Contents/ReputeMgr.cpp +++ b/Source/Contents/ReputeMgr.cpp @@ -191,7 +191,7 @@ std::vector CReputeMgr::GetGroupReputes(const std::string& gr } const ReputeVisibility visibility = found->second.visibility; - if (visibility == REPUTE_VISIBLE || (visibility == REPUTE_VISIBLE_WITH_POINT && found->second.point != 0)) { + if (REPUTE_VISIBLE == visibility || (visibility == REPUTE_VISIBLE_WITH_POINT && 0 != found->second.point)) { reputes.push_back(&found->second); } } @@ -213,7 +213,7 @@ std::vector CReputeMgr::GetAllReputes() const { } const ReputeVisibility visibility = found->second.visibility; - if (visibility == REPUTE_VISIBLE || (visibility == REPUTE_VISIBLE_WITH_POINT && found->second.point != 0)) { + if (REPUTE_VISIBLE == visibility || (visibility == REPUTE_VISIBLE_WITH_POINT && 0 != found->second.point)) { reputes.push_back(&found->second); } } diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index bbbc883e2..3b8a879d3 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -307,7 +307,7 @@ bool CBlurPC::OnProcess() { CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; if (scene) { const CRenderObject* owner = scene->GetGameActorByAidIncludeMe(this->render.accountId); - if (owner && (owner->render.flags & 0x10) != 0) { + if (owner && 0 != (owner->render.flags & 0x10)) { this->render.flags = 0x10; this->render.pulsePhases[0] = 45; } @@ -327,7 +327,7 @@ bool CHalluPC2::OnProcess() { CWorld* scene = static_cast(g_modeMgr.GetGameMode())->scene; if (scene) { const CRenderObject* owner = scene->GetGameActorByAidIncludeMe(this->render.accountId); - if (owner && (owner->render.flags & 0x10) != 0) { + if (owner && 0 != (owner->render.flags & 0x10)) { this->render.flags = 0x10; this->render.pulsePhases[0] = 45; } diff --git a/Source/Utility/Async/NAsyncWorkQueue.cpp b/Source/Utility/Async/NAsyncWorkQueue.cpp index 2ae69b5ea..2c9a87962 100644 --- a/Source/Utility/Async/NAsyncWorkQueue.cpp +++ b/Source/Utility/Async/NAsyncWorkQueue.cpp @@ -72,7 +72,8 @@ void NAsyncWorkRequestQueue::PushFront(NAsyncWorkPtr& work) { // FUNCTION: fn_07568 void NAsyncWorkRequestQueue::Complete(std::uint32_t group, std::uint32_t key) { NSyncObject held(&this->m_criticalSection); - for (auto active = this->m_active.begin(); active != this->m_active.end(); ++active) { + const auto end = this->m_active.end(); + for (auto active = this->m_active.begin(); active != end; ++active) { if (active->first == group && active->second == key) { this->m_active.erase(active); break;