diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2024-04-13 17:10:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-13 17:10:11 -0500 |
| commit | 637ae12ff447b3cbca1c7435ee841d5efed2b13b (patch) | |
| tree | 2ae5bfedbbe475c0794b9876331981de892a34ad /Source/Core/Common | |
| parent | 1bc6433404016ef07e522430f0fbb92f9fd81b33 (diff) | |
| parent | d2b96736e0d5e472afe2fc87df1ac8aa48bf3915 (diff) | |
Merge pull request #12703 from nlebeck/settingshandler-nomove-2
Pass `SettingsHandler` buffers by const ref instead of rvalue ref (since the contents are copied either way)
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/SettingsHandler.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/Common/SettingsHandler.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index dd84b6967b..e737a97620 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -22,9 +22,9 @@ SettingsHandler::SettingsHandler() Reset(); } -SettingsHandler::SettingsHandler(Buffer&& buffer) +SettingsHandler::SettingsHandler(const Buffer& buffer) { - SetBytes(std::move(buffer)); + SetBytes(buffer); } const SettingsHandler::Buffer& SettingsHandler::GetBytes() const @@ -32,10 +32,10 @@ const SettingsHandler::Buffer& SettingsHandler::GetBytes() const return m_buffer; } -void SettingsHandler::SetBytes(Buffer&& buffer) +void SettingsHandler::SetBytes(const Buffer& buffer) { Reset(); - m_buffer = std::move(buffer); + m_buffer = buffer; Decrypt(); } diff --git a/Source/Core/Common/SettingsHandler.h b/Source/Core/Common/SettingsHandler.h index c550e8e7f4..26d0a87d72 100644 --- a/Source/Core/Common/SettingsHandler.h +++ b/Source/Core/Common/SettingsHandler.h @@ -25,12 +25,12 @@ public: using Buffer = std::array<u8, SETTINGS_SIZE>; SettingsHandler(); - explicit SettingsHandler(Buffer&& buffer); + explicit SettingsHandler(const Buffer& buffer); void AddSetting(std::string_view key, std::string_view value); const Buffer& GetBytes() const; - void SetBytes(Buffer&& buffer); + void SetBytes(const Buffer& buffer); std::string GetValue(std::string_view key) const; void Decrypt(); |
