summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Debug/Watches.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-07-08 17:28:07 -0400
committerLioncash <mathew1800@gmail.com>2019-07-08 17:41:06 -0400
commitbc8778203eefcfca0597abc286de3c36edfbe6e5 (patch)
treeb39d0bab1ad4f5decd2cb56e1ba61dc334792329 /Source/Core/Common/Debug/Watches.cpp
parent0a7395bfba99719f71de5186a9916e66c1901f37 (diff)
Common/Watches: std::move strings where applicable
Allows calling code to move the std::string into the Watch instances, avoiding copies.
Diffstat (limited to 'Source/Core/Common/Debug/Watches.cpp')
-rw-r--r--Source/Core/Common/Debug/Watches.cpp16
1 files changed, 8 insertions, 8 deletions
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)