diff --git a/rpcs3/Loader/PSF.cpp b/rpcs3/Loader/PSF.cpp index 9289072a80..5cfd1e9961 100644 --- a/rpcs3/Loader/PSF.cpp +++ b/rpcs3/Loader/PSF.cpp @@ -59,7 +59,7 @@ namespace psf }; - entry::entry(format type, u32 max_size, const std::string& value) + entry::entry(format type, u32 max_size, std::string_view value) : m_type(type) , m_max_size(max_size) , m_value_string(value) @@ -91,7 +91,7 @@ namespace psf return m_value_integer; } - entry& entry::operator =(const std::string& value) + entry& entry::operator =(std::string_view value) { ensure(m_type == format::string || m_type == format::array); m_value_string = value; diff --git a/rpcs3/Loader/PSF.h b/rpcs3/Loader/PSF.h index c38e2c6393..581bd75d87 100644 --- a/rpcs3/Loader/PSF.h +++ b/rpcs3/Loader/PSF.h @@ -36,7 +36,7 @@ namespace psf public: // Construct string entry, assign the value - entry(format type, u32 max_size, const std::string& value = {}); + entry(format type, u32 max_size, std::string_view value); // Construct integer entry, assign the value entry(u32 value); @@ -46,7 +46,7 @@ namespace psf const std::string& as_string() const; u32 as_integer() const; - entry& operator =(const std::string& value); + entry& operator =(std::string_view value); entry& operator =(u32 value); format type() const { return m_type; } @@ -100,12 +100,12 @@ namespace psf // Make string entry inline entry string(u32 max_size, std::string_view value) { - return {format::string, max_size, std::string(value)}; + return {format::string, max_size, value}; } // Make array entry inline entry array(u32 max_size, std::string_view value) { - return {format::array, max_size, std::string(value)}; + return {format::array, max_size, value}; } }