VolumeDirectory: Pass std::string by reference for SetUniqueID/SetName

This commit is contained in:
Lioncash 2014-10-28 13:52:36 -04:00
parent 64b09582c6
commit 56bc58b9f4
2 changed files with 4 additions and 4 deletions

View File

@ -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)
@ -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)

View File

@ -36,12 +36,12 @@ public:
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;