UICommon/ResourcePack: Allow priority helpers to take arguments by const reference

There's nothing going on with behavior here that would prevent these
from being const qualified.

Also better communicates that this function isn't intended to modify the
given resource pack.
This commit is contained in:
Lioncash 2023-06-16 10:19:38 -04:00
parent f0f8225ff8
commit 653d6d059f
2 changed files with 4 additions and 4 deletions

View File

@ -82,7 +82,7 @@ std::vector<ResourcePack>& GetPacks()
return packs;
}
std::vector<ResourcePack*> GetLowerPriorityPacks(ResourcePack& pack)
std::vector<ResourcePack*> GetLowerPriorityPacks(const ResourcePack& pack)
{
std::vector<ResourcePack*> list;
for (auto it = std::find(packs.begin(), packs.end(), pack) + 1; it != packs.end(); ++it)
@ -97,7 +97,7 @@ std::vector<ResourcePack*> GetLowerPriorityPacks(ResourcePack& pack)
return list;
}
std::vector<ResourcePack*> GetHigherPriorityPacks(ResourcePack& pack)
std::vector<ResourcePack*> GetHigherPriorityPacks(const ResourcePack& pack)
{
std::vector<ResourcePack*> list;
auto end = std::find(packs.begin(), packs.end(), pack);

View File

@ -19,6 +19,6 @@ bool IsInstalled(const ResourcePack& pack);
std::vector<ResourcePack>& GetPacks();
std::vector<ResourcePack*> GetHigherPriorityPacks(ResourcePack& pack);
std::vector<ResourcePack*> GetLowerPriorityPacks(ResourcePack& pack);
std::vector<ResourcePack*> GetHigherPriorityPacks(const ResourcePack& pack);
std::vector<ResourcePack*> GetLowerPriorityPacks(const ResourcePack& pack);
} // namespace ResourcePack