From e9dd2c57a674ac81c526c569bdc5f5ebd4da810d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Jun 2020 06:34:22 -0400 Subject: [PATCH] CResTypeInfo: Shorten std::sort call We can remove unnecessary qualifiers to make this a little less verbose. --- src/Core/Resource/CResTypeInfo.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/Resource/CResTypeInfo.cpp b/src/Core/Resource/CResTypeInfo.cpp index adac8b1c..b18af4c6 100644 --- a/src/Core/Resource/CResTypeInfo.cpp +++ b/src/Core/Resource/CResTypeInfo.cpp @@ -155,18 +155,18 @@ void CResTypeInfo::CResTypeInfoFactory::AddExtension(CResTypeInfo *pType, CFourC ASSERT(FirstGame >= EGame::PrimeDemo && LastGame <= EGame::DKCReturns && FirstGame <= LastGame); ASSERT(FirstGame != EGame::Invalid && LastGame != EGame::Invalid); - for (int GameIdx = (int) FirstGame; GameIdx <= (int) LastGame; GameIdx++) + for (int GameIdx = static_cast(FirstGame); GameIdx <= static_cast(LastGame); GameIdx++) { #if !PUBLIC_RELEASE - ASSERT(!pType->IsInGame((EGame) GameIdx)); + ASSERT(!pType->IsInGame(static_cast(GameIdx))); #endif - CResTypeInfo::SGameExtension Info { (EGame) GameIdx, Ext }; + SGameExtension Info{static_cast(GameIdx), Ext}; pType->mCookedExtensions.push_back(Info); } - std::sort(pType->mCookedExtensions.begin(), pType->mCookedExtensions.end(), [](const CResTypeInfo::SGameExtension& rkLeft, const CResTypeInfo::SGameExtension& rkRight) -> bool { - return rkLeft.Game < rkRight.Game; + std::sort(pType->mCookedExtensions.begin(), pType->mCookedExtensions.end(), [](const SGameExtension& left, const SGameExtension& right) { + return left.Game < right.Game; }); }