Skip to content

Commit

Permalink
Merge pull request #1430 from lioncash/voldir
Browse files Browse the repository at this point in the history
VolumeDirectory: Pass std::string by reference for SetUniqueID/SetName
  • Loading branch information
comex committed Oct 29, 2014
2 parents 6618337 + 56bc58b commit 3247f28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Source/Core/DiscIO/VolumeDirectory.cpp
Expand Up @@ -152,7 +152,7 @@ std::string CVolumeDirectory::GetUniqueID() const
return std::string(m_diskHeader.begin(), m_diskHeader.begin() + ID_LENGTH);
}

void CVolumeDirectory::SetUniqueID(std::string id)
void CVolumeDirectory::SetUniqueID(const std::string& id)
{
size_t length = id.length();
if (length > 6)
Expand All @@ -178,7 +178,7 @@ std::vector<std::string> CVolumeDirectory::GetNames() const
return std::vector<std::string>(1, (char*)(&m_diskHeader[0x20]));
}

void CVolumeDirectory::SetName(std::string name)
void CVolumeDirectory::SetName(const std::string& name)
{
size_t length = name.length();
if (length > MAX_NAME_LENGTH)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DiscIO/VolumeDirectory.h
Expand Up @@ -36,12 +36,12 @@ class CVolumeDirectory : public IVolume
bool RAWRead(u64 _Offset, u64 _Length, u8* _pBuffer) const override;

std::string GetUniqueID() const override;
void SetUniqueID(std::string _ID);
void SetUniqueID(const std::string& _ID);

std::string GetMakerID() const override;

std::vector<std::string> GetNames() const override;
void SetName(std::string);
void SetName(const std::string&);

u32 GetFSTSize() const override;

Expand Down

0 comments on commit 3247f28

Please sign in to comment.