diff --git a/Source/Core/Core/HW/GCMemcardDirectory.cpp b/Source/Core/Core/HW/GCMemcardDirectory.cpp index 0ac4199a82..a01f70bad1 100644 --- a/Source/Core/Core/HW/GCMemcardDirectory.cpp +++ b/Source/Core/Core/HW/GCMemcardDirectory.cpp @@ -13,7 +13,7 @@ const int NO_INDEX = -1; static const char *MC_HDR = "MC_SYSTEM_AREA"; -int GCMemcardDirectory::LoadGCI(std::string fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly) +int GCMemcardDirectory::LoadGCI(const std::string& fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly) { File::IOFile gcifile(fileName, "rb"); if (gcifile) @@ -131,7 +131,7 @@ int GCMemcardDirectory::LoadGCI(std::string fileName, DiscIO::IVolume::ECountry return NO_INDEX; } -GCMemcardDirectory::GCMemcardDirectory(std::string directory, int slot, u16 sizeMb, bool ascii, DiscIO::IVolume::ECountry card_region, int gameId) +GCMemcardDirectory::GCMemcardDirectory(const std::string& directory, int slot, u16 sizeMb, bool ascii, DiscIO::IVolume::ECountry card_region, int gameId) : MemoryCardBase(slot, sizeMb) , m_GameId(gameId) , m_LastBlock(-1) @@ -652,7 +652,7 @@ void GCIFile::DoState(PointerWrap &p) p.Do(m_used_blocks); } -void MigrateFromMemcardFile(std::string strDirectoryName, int card_index) +void MigrateFromMemcardFile(const std::string& strDirectoryName, int card_index) { File::CreateFullPath(strDirectoryName); std::string ini_memcard = diff --git a/Source/Core/Core/HW/GCMemcardDirectory.h b/Source/Core/Core/HW/GCMemcardDirectory.h index 699d70d5cc..3d0425e1b1 100644 --- a/Source/Core/Core/HW/GCMemcardDirectory.h +++ b/Source/Core/Core/HW/GCMemcardDirectory.h @@ -9,12 +9,12 @@ // Uncomment this to write the system data of the memorycard from directory to disc //#define _WRITE_MC_HEADER 1 -void MigrateFromMemcardFile(std::string strDirectoryName, int card_index); +void MigrateFromMemcardFile(const std::string& strDirectoryName, int card_index); class GCMemcardDirectory : public MemoryCardBase, NonCopyable { public: - GCMemcardDirectory(std::string directory, int slot = 0, u16 sizeMb = MemCard2043Mb, bool ascii = true, + GCMemcardDirectory(const std::string& directory, int slot = 0, u16 sizeMb = MemCard2043Mb, bool ascii = true, DiscIO::IVolume::ECountry card_region = DiscIO::IVolume::COUNTRY_EUROPE, int gameId = 0); ~GCMemcardDirectory(); void FlushToFile(); @@ -26,7 +26,7 @@ public: void DoState(PointerWrap &p) override; private: - int LoadGCI(std::string fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly); + int LoadGCI(const std::string& fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly); inline s32 SaveAreaRW(u32 block, bool writing = false); // s32 DirectoryRead(u32 offset, u32 length, u8* destaddress); s32 DirectoryWrite(u32 destaddress, u32 length, u8 *srcaddress);