General: Qualify const where applicable

This commit is contained in:
Lioncash 2020-06-22 02:11:03 -04:00
parent 2b7513b156
commit 46926ef4bf
5 changed files with 9 additions and 10 deletions

View File

@ -301,7 +301,7 @@ CResourceEntry* CResourceStore::FindEntry(const CAssetID& rkID) const
if (Found != mResourceEntries.cend())
{
auto& pEntry = Found->second;
const auto& pEntry = Found->second;
if (!pEntry->IsMarkedForDeletion())
return pEntry.get();
@ -450,7 +450,7 @@ CResourceEntry* CResourceStore::CreateNewResource(const CAssetID& rkID, EResourc
if (IsValidResourcePath(rkDir, rkName))
{
auto res = CResourceEntry::CreateNewResource(this, rkID, rkDir, rkName, Type, ExistingResource);
auto resPtr = res.get();
auto* resPtr = res.get();
mResourceEntries.insert_or_assign(rkID, std::move(res));
mDatabaseCacheDirty = true;

View File

@ -145,16 +145,15 @@ public:
std::set<CAnimPrimitive> PrimitiveSet;
// Animations
for (auto& anim : mAnimations)
for (const auto& anim : mAnimations)
{
anim.pMetaAnim->GetUniquePrimitives(PrimitiveSet);
}
CSourceAnimData *pAnimData = gpResourceStore->LoadResource<CSourceAnimData>(rkChar.AnimDataID);
if (pAnimData)
if (auto* pAnimData = gpResourceStore->LoadResource<CSourceAnimData>(rkChar.AnimDataID))
pAnimData->AddTransitionDependencies(pTree.get());
for (auto& prim : PrimitiveSet)
for (const auto& prim : PrimitiveSet)
{
pTree->AddDependency(prim.Animation());
}

View File

@ -102,7 +102,7 @@ public:
break;
// Add all transition primitives to the tree
for (auto& primitive : PrimSet)
for (const auto& primitive : PrimSet)
pTree->AddDependency(primitive.Animation());
}
}

View File

@ -101,7 +101,7 @@ EMetaAnimType CMetaAnimRandom::Type() const
void CMetaAnimRandom::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
{
for (auto& pair : mProbabilityPairs)
for (const auto& pair : mProbabilityPairs)
pair.pAnim->GetUniquePrimitives(rPrimSet);
}
@ -126,6 +126,6 @@ EMetaAnimType CMetaAnimSequence::Type() const
void CMetaAnimSequence::GetUniquePrimitives(std::set<CAnimPrimitive>& rPrimSet) const
{
for (auto& anim : mAnimations)
for (const auto& anim : mAnimations)
anim->GetUniquePrimitives(rPrimSet);
}

View File

@ -41,7 +41,7 @@ void CResTypeInfo::GetAllTypesInGame(EGame Game, std::list<CResTypeInfo*>& rOut)
{
for (const auto& entry : smTypeMap)
{
auto& type = entry.second;
const auto& type = entry.second;
if (type->IsInGame(Game))
rOut.push_back(type.get());