diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp index 175ee18f17..68047dd8c9 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.cpp +++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp @@ -490,8 +490,8 @@ static void ApplyFolderPatchToFST(const Patch& patch, const Folder& folder, ApplyFolderPatchToFST(patch, folder, fst, dol_node, folder.m_disc, folder.m_external); } -void ApplyPatchesToFiles(const std::vector& patches, PatchIndex index, - std::vector* fst, DiscIO::FSTBuilderNode* dol_node) +void ApplyPatchesToFiles(std::span patches, PatchIndex index, + std::vector* fst, FSTBuilderNode* dol_node) { for (const auto& patch : patches) { @@ -509,7 +509,7 @@ void ApplyPatchesToFiles(const std::vector& patches, PatchIndex index, } static bool MemoryMatchesAt(const Core::CPUThreadGuard& guard, u32 offset, - const std::vector& value) + std::span value) { for (u32 i = 0; i < value.size(); ++i) { @@ -521,7 +521,7 @@ static bool MemoryMatchesAt(const Core::CPUThreadGuard& guard, u32 offset, } static void ApplyMemoryPatch(const Core::CPUThreadGuard& guard, u32 offset, - const std::vector& value, const std::vector& original) + std::span value, std::span original) { #ifdef USE_RETRO_ACHIEVEMENTS if (::Config::Get(::Config::RA_HARDCORE_ENABLED)) @@ -622,10 +622,10 @@ static void ApplyOcarinaMemoryPatch(const Core::CPUThreadGuard& guard, const Pat } } -void ApplyGeneralMemoryPatches(const Core::CPUThreadGuard& guard, const std::vector& patches) +void ApplyGeneralMemoryPatches(const Core::CPUThreadGuard& guard, std::span patches) { - auto& system = Core::System::GetInstance(); - auto& system_memory = system.GetMemory(); + const auto& system = Core::System::GetInstance(); + const auto& system_memory = system.GetMemory(); for (const auto& patch : patches) { @@ -642,8 +642,8 @@ void ApplyGeneralMemoryPatches(const Core::CPUThreadGuard& guard, const std::vec } } -void ApplyApploaderMemoryPatches(const Core::CPUThreadGuard& guard, - const std::vector& patches, u32 ram_address, u32 ram_length) +void ApplyApploaderMemoryPatches(const Core::CPUThreadGuard& guard, std::span patches, + u32 ram_address, u32 ram_length) { for (const auto& patch : patches) { @@ -660,8 +660,7 @@ void ApplyApploaderMemoryPatches(const Core::CPUThreadGuard& guard, } } -std::optional -ExtractSavegameRedirect(const std::vector& riivolution_patches) +std::optional ExtractSavegameRedirect(std::span riivolution_patches) { for (const auto& patch : riivolution_patches) { diff --git a/Source/Core/DiscIO/RiivolutionPatcher.h b/Source/Core/DiscIO/RiivolutionPatcher.h index d83c51d686..13d5086455 100644 --- a/Source/Core/DiscIO/RiivolutionPatcher.h +++ b/Source/Core/DiscIO/RiivolutionPatcher.h @@ -4,6 +4,7 @@ #pragma once #include +#include #include #include #include @@ -76,14 +77,10 @@ enum class PatchIndex DolphinSysFiles, }; -void ApplyPatchesToFiles(const std::vector& patches, PatchIndex index, - std::vector* fst, - DiscIO::FSTBuilderNode* dol_node); -void ApplyGeneralMemoryPatches(const Core::CPUThreadGuard& guard, - const std::vector& patches); -void ApplyApploaderMemoryPatches(const Core::CPUThreadGuard& guard, - const std::vector& patches, u32 ram_address, - u32 ram_length); -std::optional -ExtractSavegameRedirect(const std::vector& riivolution_patches); +void ApplyPatchesToFiles(std::span patches, PatchIndex index, + std::vector* fst, FSTBuilderNode* dol_node); +void ApplyGeneralMemoryPatches(const Core::CPUThreadGuard& guard, std::span patches); +void ApplyApploaderMemoryPatches(const Core::CPUThreadGuard& guard, std::span patches, + u32 ram_address, u32 ram_length); +std::optional ExtractSavegameRedirect(std::span riivolution_patches); } // namespace DiscIO::Riivolution