From 02e4e4da01b4e0560345e20650589c0c78a9bd41 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Fri, 26 Aug 2022 15:11:34 +0200 Subject: [PATCH] USB: Cleanup const reference warnings. Codacy warning: Function parameter should be passed by const reference. --- pcsx2/USB/shared/inifile_usb.cpp | 8 ++++---- pcsx2/USB/shared/inifile_usb.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pcsx2/USB/shared/inifile_usb.cpp b/pcsx2/USB/shared/inifile_usb.cpp index 7d2690763d..c18dab9f9d 100644 --- a/pcsx2/USB/shared/inifile_usb.cpp +++ b/pcsx2/USB/shared/inifile_usb.cpp @@ -465,7 +465,7 @@ const KeyIndexA& CIniSectionA::GetKeys() const return m_keys; } -std::string CIniSectionA::GetKeyValue(std::string sKey) const +std::string CIniSectionA::GetKeyValue(const std::string& sKey) const { std::string sValue; CIniKeyA* pKey = GetKey(sKey); @@ -476,7 +476,7 @@ std::string CIniSectionA::GetKeyValue(std::string sKey) const return sValue; } -void CIniSectionA::SetKeyValue(std::string sKey, const std::string& sValue) +void CIniSectionA::SetKeyValue(const std::string& sKey, const std::string& sValue) { CIniKeyA* pKey = AddKey(sKey); if (pKey) @@ -965,7 +965,7 @@ const KeyIndexW& CIniSectionW::GetKeys() const return m_keys; } -std::wstring CIniSectionW::GetKeyValue(std::wstring sKey) const +std::wstring CIniSectionW::GetKeyValue(const std::wstring& sKey) const { std::wstring sValue; CIniKeyW* pKey = GetKey(sKey); @@ -976,7 +976,7 @@ std::wstring CIniSectionW::GetKeyValue(std::wstring sKey) const return sValue; } -void CIniSectionW::SetKeyValue(std::wstring sKey, const std::wstring& sValue) +void CIniSectionW::SetKeyValue(const std::wstring& sKey, const std::wstring& sValue) { CIniKeyW* pKey = AddKey(sKey); if (pKey) diff --git a/pcsx2/USB/shared/inifile_usb.h b/pcsx2/USB/shared/inifile_usb.h index d6355bb6ca..a21587e5cf 100644 --- a/pcsx2/USB/shared/inifile_usb.h +++ b/pcsx2/USB/shared/inifile_usb.h @@ -203,9 +203,9 @@ public: // Returns all keys in the section by KeyIndex only to be used for enumeration const KeyIndexA& GetKeys() const; // Returns a KeyValue at a certain section - std::string GetKeyValue(std::string sKey) const; + std::string GetKeyValue(const std::string& sKey) const; // Sets a KeyValuePair at a certain section - void SetKeyValue(std::string sKey, const std::string& sValue); + void SetKeyValue(const std::string& sKey, const std::string& sValue); // Sets the section name, returns true on success, fails if the section // name sSectionName already exists bool SetSectionName(std::string sSectionName); @@ -439,9 +439,9 @@ public: // Returns all keys in the section by KeyIndex only to be used for enumeration const KeyIndexW& GetKeys() const; // Returns a KeyValue at a certain section - std::wstring GetKeyValue(std::wstring sKey) const; + std::wstring GetKeyValue(const std::wstring& sKey) const; // Sets a KeyValuePair at a certain section - void SetKeyValue(std::wstring sKey, const std::wstring& sValue); + void SetKeyValue(const std::wstring& sKey, const std::wstring& sValue); // Sets the section name, returns true on success, fails if the section // name sSectionName already exists bool SetSectionName(std::wstring sSectionName);