diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.cpp b/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.cpp index c7cc7942f8..e16b452774 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.cpp +++ b/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.cpp @@ -75,7 +75,7 @@ bool HasSameIdentity(const DEntry& lhs, const DEntry& rhs) return true; } -bool HasDuplicateIdentity(const std::vector& savefiles) +bool HasDuplicateIdentity(std::span savefiles) { for (size_t i = 0; i < savefiles.size(); ++i) { @@ -338,7 +338,7 @@ std::string GetDefaultExtension(SavefileFormat format) } } -std::vector GetSavefiles(const GCMemcard& card, const std::vector& file_indices) +std::vector GetSavefiles(const GCMemcard& card, std::span file_indices) { std::vector files; files.reserve(file_indices.size()); @@ -352,7 +352,7 @@ std::vector GetSavefiles(const GCMemcard& card, const std::vector& return files; } -size_t GetBlockCount(const std::vector& savefiles) +size_t GetBlockCount(std::span savefiles) { size_t block_count = 0; for (const Savefile& savefile : savefiles) diff --git a/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.h b/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.h index 4aa74fdce9..b4d0624888 100644 --- a/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.h +++ b/Source/Core/Core/HW/GCMemcard/GCMemcardUtils.h @@ -3,8 +3,11 @@ #pragma once +#include +#include #include #include +#include #include "Core/HW/GCMemcard/GCMemcard.h" @@ -13,7 +16,7 @@ namespace Memcard bool HasSameIdentity(const DEntry& lhs, const DEntry& rhs); // Check if any two given savefiles have the same identity. -bool HasDuplicateIdentity(const std::vector& savefiles); +bool HasDuplicateIdentity(std::span savefiles); enum class ReadSavefileErrorCode { @@ -43,8 +46,8 @@ std::string GenerateFilename(const DEntry& entry); std::string GetDefaultExtension(SavefileFormat format); // Reads multiple savefiles from a card. Returns empty vector if even a single file can't be read. -std::vector GetSavefiles(const GCMemcard& card, const std::vector& file_indices); +std::vector GetSavefiles(const GCMemcard& card, std::span file_indices); // Gets the total amount of blocks the given saves use. -size_t GetBlockCount(const std::vector& savefiles); +size_t GetBlockCount(std::span savefiles); } // namespace Memcard diff --git a/Source/Core/DolphinQt/GCMemcardManager.cpp b/Source/Core/DolphinQt/GCMemcardManager.cpp index 8f7646774a..8bbe9061dc 100644 --- a/Source/Core/DolphinQt/GCMemcardManager.cpp +++ b/Source/Core/DolphinQt/GCMemcardManager.cpp @@ -502,7 +502,7 @@ void GCMemcardManager::ExportFiles(Memcard::SavefileFormat format) } } -void GCMemcardManager::ImportFiles(Slot slot, const std::vector& savefiles) +void GCMemcardManager::ImportFiles(Slot slot, std::span savefiles) { auto& card = m_slot_memcard[slot]; if (!card) diff --git a/Source/Core/DolphinQt/GCMemcardManager.h b/Source/Core/DolphinQt/GCMemcardManager.h index 838a7750d7..dcc4b3324b 100644 --- a/Source/Core/DolphinQt/GCMemcardManager.h +++ b/Source/Core/DolphinQt/GCMemcardManager.h @@ -3,10 +3,9 @@ #pragma once -#include #include #include -#include +#include #include #include @@ -62,7 +61,7 @@ private: std::vector GetSelectedFileIndices(); - void ImportFiles(ExpansionInterface::Slot slot, const std::vector& savefiles); + void ImportFiles(ExpansionInterface::Slot slot, std::span savefiles); void CopyFiles(); void ImportFile();