From c23131d046d2b0dd6e0a979c0664ba4c000fb1b3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 31 Oct 2014 10:17:24 -0400 Subject: [PATCH] GCMemcardDirectory: Pass std::strings by reference. --- Source/Core/Core/HW/GCMemcardDirectory.cpp | 6 +++--- Source/Core/Core/HW/GCMemcardDirectory.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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);