From 653d6d059fbc08a5db4803529c20eef387823f25 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 16 Jun 2023 10:19:38 -0400 Subject: [PATCH] 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. --- Source/Core/UICommon/ResourcePack/Manager.cpp | 4 ++-- Source/Core/UICommon/ResourcePack/Manager.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/UICommon/ResourcePack/Manager.cpp b/Source/Core/UICommon/ResourcePack/Manager.cpp index 8d5e934c55..d57cbb498a 100644 --- a/Source/Core/UICommon/ResourcePack/Manager.cpp +++ b/Source/Core/UICommon/ResourcePack/Manager.cpp @@ -82,7 +82,7 @@ std::vector& GetPacks() return packs; } -std::vector GetLowerPriorityPacks(ResourcePack& pack) +std::vector GetLowerPriorityPacks(const ResourcePack& pack) { std::vector list; for (auto it = std::find(packs.begin(), packs.end(), pack) + 1; it != packs.end(); ++it) @@ -97,7 +97,7 @@ std::vector GetLowerPriorityPacks(ResourcePack& pack) return list; } -std::vector GetHigherPriorityPacks(ResourcePack& pack) +std::vector GetHigherPriorityPacks(const ResourcePack& pack) { std::vector list; auto end = std::find(packs.begin(), packs.end(), pack); diff --git a/Source/Core/UICommon/ResourcePack/Manager.h b/Source/Core/UICommon/ResourcePack/Manager.h index da81c7d40b..492a69e9ad 100644 --- a/Source/Core/UICommon/ResourcePack/Manager.h +++ b/Source/Core/UICommon/ResourcePack/Manager.h @@ -19,6 +19,6 @@ bool IsInstalled(const ResourcePack& pack); std::vector& GetPacks(); -std::vector GetHigherPriorityPacks(ResourcePack& pack); -std::vector GetLowerPriorityPacks(ResourcePack& pack); +std::vector GetHigherPriorityPacks(const ResourcePack& pack); +std::vector GetLowerPriorityPacks(const ResourcePack& pack); } // namespace ResourcePack