summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2017-04-30 03:04:50 -0400
committerLioncash <mathew1800@gmail.com>2017-04-30 03:22:34 -0400
commit4c70f05fe0d2ba706c8c24da1d2149f79551ce9f (patch)
tree75eae0f1a809990db6e113442aaf87527f24315b /Source/Core/DolphinWX/Debugger/MemoryWindow.cpp
parent7cf78a00eb1b10116ee0f1239266c488ba6d31d5 (diff)
MemoryWindow: Get rid of unnecessary std::string constructions
std::string's operator+ will handle this. Also move std::string to where they're actually needed. There's no need to construct an unnecessary string if the first failure case occurs.
Diffstat (limited to 'Source/Core/DolphinWX/Debugger/MemoryWindow.cpp')
-rw-r--r--Source/Core/DolphinWX/Debugger/MemoryWindow.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp b/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp
index f1f3b06772..3422f2c2ef 100644
--- a/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp
+++ b/Source/Core/DolphinWX/Debugger/MemoryWindow.cpp
@@ -176,17 +176,16 @@ void CMemoryWindow::OnSetMemoryValue(wxCommandEvent& event)
}
std::string str_addr = WxStrToStr(m_address_search_ctrl->GetValue());
- std::string str_val = WxStrToStr(m_value_text_ctrl->GetValue());
u32 addr;
- u32 val;
-
- if (!TryParse(std::string("0x") + str_addr, &addr))
+ if (!TryParse("0x" + str_addr, &addr))
{
WxUtils::ShowErrorDialog(wxString::Format(_("Invalid address: %s"), str_addr.c_str()));
return;
}
- if (!TryParse(std::string("0x") + str_val, &val))
+ std::string str_val = WxStrToStr(m_value_text_ctrl->GetValue());
+ u32 val;
+ if (!TryParse("0x" + str_val, &val))
{
WxUtils::ShowErrorDialog(wxString::Format(_("Invalid value: %s"), str_val.c_str()));
return;