diff --git a/Source/Core/Common/Debug/Watches.cpp b/Source/Core/Common/Debug/Watches.cpp index 3668af1626..9114f2e83d 100644 --- a/Source/Core/Common/Debug/Watches.cpp +++ b/Source/Core/Common/Debug/Watches.cpp @@ -9,12 +9,12 @@ namespace Common::Debug { -Watch::Watch(u32 address_, const std::string& name_, Watch::State is_enabled_) - : address(address_), name(name_), is_enabled(is_enabled_) +Watch::Watch(u32 address_, std::string name_, State is_enabled_) + : address(address_), name(std::move(name_)), is_enabled(is_enabled_) { } -std::size_t Watches::SetWatch(u32 address, const std::string& name) +std::size_t Watches::SetWatch(u32 address, std::string name) { const std::size_t size = m_watches.size(); for (std::size_t index = 0; index < size; index++) @@ -25,7 +25,7 @@ std::size_t Watches::SetWatch(u32 address, const std::string& name) return index; } } - m_watches.emplace_back(address, name, Watch::State::Enabled); + m_watches.emplace_back(address, std::move(name), Watch::State::Enabled); return size; } @@ -46,10 +46,10 @@ void Watches::UnsetWatch(u32 address) m_watches.end()); } -void Watches::UpdateWatch(std::size_t index, u32 address, const std::string& name) +void Watches::UpdateWatch(std::size_t index, u32 address, std::string name) { m_watches[index].address = address; - m_watches[index].name = name; + m_watches[index].name = std::move(name); } void Watches::UpdateWatchAddress(std::size_t index, u32 address) @@ -57,9 +57,9 @@ void Watches::UpdateWatchAddress(std::size_t index, u32 address) m_watches[index].address = address; } -void Watches::UpdateWatchName(std::size_t index, const std::string& name) +void Watches::UpdateWatchName(std::size_t index, std::string name) { - m_watches[index].name = name; + m_watches[index].name = std::move(name); } void Watches::EnableWatch(std::size_t index) diff --git a/Source/Core/Common/Debug/Watches.h b/Source/Core/Common/Debug/Watches.h index 1134f20900..fcf5c795bf 100644 --- a/Source/Core/Common/Debug/Watches.h +++ b/Source/Core/Common/Debug/Watches.h @@ -24,19 +24,19 @@ struct Watch std::string name; State is_enabled; - Watch(u32 address, const std::string& name, State is_enabled); + Watch(u32 address, std::string name, State is_enabled); }; class Watches { public: - std::size_t SetWatch(u32 address, const std::string& name); + std::size_t SetWatch(u32 address, std::string name); const Watch& GetWatch(std::size_t index) const; const std::vector& GetWatches() const; void UnsetWatch(u32 address); - void UpdateWatch(std::size_t index, u32 address, const std::string& name); + void UpdateWatch(std::size_t index, u32 address, std::string name); void UpdateWatchAddress(std::size_t index, u32 address); - void UpdateWatchName(std::size_t index, const std::string& name); + void UpdateWatchName(std::size_t index, std::string name); void EnableWatch(std::size_t index); void DisableWatch(std::size_t index); bool HasEnabledWatch(u32 address) const; diff --git a/Source/Core/Common/DebugInterface.h b/Source/Core/Common/DebugInterface.h index e73c44ee28..0368f55f1e 100644 --- a/Source/Core/Common/DebugInterface.h +++ b/Source/Core/Common/DebugInterface.h @@ -22,13 +22,13 @@ protected: public: // Watches - virtual std::size_t SetWatch(u32 address, const std::string& name = "") = 0; + virtual std::size_t SetWatch(u32 address, std::string name = "") = 0; virtual const Common::Debug::Watch& GetWatch(std::size_t index) const = 0; virtual const std::vector& GetWatches() const = 0; virtual void UnsetWatch(u32 address) = 0; - virtual void UpdateWatch(std::size_t index, u32 address, const std::string& name) = 0; + virtual void UpdateWatch(std::size_t index, u32 address, std::string name) = 0; virtual void UpdateWatchAddress(std::size_t index, u32 address) = 0; - virtual void UpdateWatchName(std::size_t index, const std::string& name) = 0; + virtual void UpdateWatchName(std::size_t index, std::string name) = 0; virtual void EnableWatch(std::size_t index) = 0; virtual void DisableWatch(std::size_t index) = 0; virtual bool HasEnabledWatch(u32 address) const = 0; diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.cpp b/Source/Core/Core/Debugger/PPCDebugInterface.cpp index 394a8c4eb7..d8840b5e14 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.cpp +++ b/Source/Core/Core/Debugger/PPCDebugInterface.cpp @@ -44,9 +44,9 @@ void PPCPatches::Patch(std::size_t index) } } -std::size_t PPCDebugInterface::SetWatch(u32 address, const std::string& name) +std::size_t PPCDebugInterface::SetWatch(u32 address, std::string name) { - return m_watches.SetWatch(address, name); + return m_watches.SetWatch(address, std::move(name)); } const Common::Debug::Watch& PPCDebugInterface::GetWatch(std::size_t index) const @@ -64,9 +64,9 @@ void PPCDebugInterface::UnsetWatch(u32 address) m_watches.UnsetWatch(address); } -void PPCDebugInterface::UpdateWatch(std::size_t index, u32 address, const std::string& name) +void PPCDebugInterface::UpdateWatch(std::size_t index, u32 address, std::string name) { - return m_watches.UpdateWatch(index, address, name); + return m_watches.UpdateWatch(index, address, std::move(name)); } void PPCDebugInterface::UpdateWatchAddress(std::size_t index, u32 address) @@ -74,9 +74,9 @@ void PPCDebugInterface::UpdateWatchAddress(std::size_t index, u32 address) return m_watches.UpdateWatchAddress(index, address); } -void PPCDebugInterface::UpdateWatchName(std::size_t index, const std::string& name) +void PPCDebugInterface::UpdateWatchName(std::size_t index, std::string name) { - return m_watches.UpdateWatchName(index, name); + return m_watches.UpdateWatchName(index, std::move(name)); } void PPCDebugInterface::EnableWatch(std::size_t index) @@ -121,7 +121,7 @@ void PPCDebugInterface::SetPatch(u32 address, u32 value) void PPCDebugInterface::SetPatch(u32 address, std::vector value) { - m_patches.SetPatch(address, value); + m_patches.SetPatch(address, std::move(value)); } const std::vector& PPCDebugInterface::GetPatches() const diff --git a/Source/Core/Core/Debugger/PPCDebugInterface.h b/Source/Core/Core/Debugger/PPCDebugInterface.h index d0b9a9625d..36ff0f9c32 100644 --- a/Source/Core/Core/Debugger/PPCDebugInterface.h +++ b/Source/Core/Core/Debugger/PPCDebugInterface.h @@ -22,13 +22,13 @@ class PPCDebugInterface final : public Common::DebugInterface public: PPCDebugInterface() {} // Watches - std::size_t SetWatch(u32 address, const std::string& name = "") override; + std::size_t SetWatch(u32 address, std::string name = "") override; const Common::Debug::Watch& GetWatch(std::size_t index) const override; const std::vector& GetWatches() const override; void UnsetWatch(u32 address) override; - void UpdateWatch(std::size_t index, u32 address, const std::string& name) override; + void UpdateWatch(std::size_t index, u32 address, std::string name) override; void UpdateWatchAddress(std::size_t index, u32 address) override; - void UpdateWatchName(std::size_t index, const std::string& name) override; + void UpdateWatchName(std::size_t index, std::string name) override; void EnableWatch(std::size_t index) override; void DisableWatch(std::size_t index) override; bool HasEnabledWatch(u32 address) const override; diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp index a8a16554ed..3a5d2b8c14 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.cpp @@ -20,9 +20,9 @@ void DSPPatches::Patch(std::size_t index) PanicAlert("Patch functionality not supported in DSP module."); } -std::size_t DSPDebugInterface::SetWatch(u32 address, const std::string& name) +std::size_t DSPDebugInterface::SetWatch(u32 address, std::string name) { - return m_watches.SetWatch(address, name); + return m_watches.SetWatch(address, std::move(name)); } const Common::Debug::Watch& DSPDebugInterface::GetWatch(std::size_t index) const @@ -40,9 +40,9 @@ void DSPDebugInterface::UnsetWatch(u32 address) m_watches.UnsetWatch(address); } -void DSPDebugInterface::UpdateWatch(std::size_t index, u32 address, const std::string& name) +void DSPDebugInterface::UpdateWatch(std::size_t index, u32 address, std::string name) { - return m_watches.UpdateWatch(index, address, name); + return m_watches.UpdateWatch(index, address, std::move(name)); } void DSPDebugInterface::UpdateWatchAddress(std::size_t index, u32 address) @@ -50,9 +50,9 @@ void DSPDebugInterface::UpdateWatchAddress(std::size_t index, u32 address) return m_watches.UpdateWatchAddress(index, address); } -void DSPDebugInterface::UpdateWatchName(std::size_t index, const std::string& name) +void DSPDebugInterface::UpdateWatchName(std::size_t index, std::string name) { - return m_watches.UpdateWatchName(index, name); + return m_watches.UpdateWatchName(index, std::move(name)); } void DSPDebugInterface::EnableWatch(std::size_t index) @@ -97,7 +97,7 @@ void DSPDebugInterface::SetPatch(u32 address, u32 value) void DSPDebugInterface::SetPatch(u32 address, std::vector value) { - m_patches.SetPatch(address, value); + m_patches.SetPatch(address, std::move(value)); } const std::vector& DSPDebugInterface::GetPatches() const diff --git a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h index e2d1a5242b..c1cd0507cf 100644 --- a/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h +++ b/Source/Core/Core/HW/DSPLLE/DSPDebugInterface.h @@ -23,13 +23,13 @@ class DSPDebugInterface final : public Common::DebugInterface public: DSPDebugInterface() {} // Watches - std::size_t SetWatch(u32 address, const std::string& name = "") override; + std::size_t SetWatch(u32 address, std::string name = "") override; const Common::Debug::Watch& GetWatch(std::size_t index) const override; const std::vector& GetWatches() const override; void UnsetWatch(u32 address) override; - void UpdateWatch(std::size_t index, u32 address, const std::string& name) override; + void UpdateWatch(std::size_t index, u32 address, std::string name) override; void UpdateWatchAddress(std::size_t index, u32 address) override; - void UpdateWatchName(std::size_t index, const std::string& name) override; + void UpdateWatchName(std::size_t index, std::string name) override; void EnableWatch(std::size_t index) override; void DisableWatch(std::size_t index) override; bool HasEnabledWatch(u32 address) const override;