summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-07-30 07:57:06 -0400
committerLioncash <mathew1800@gmail.com>2019-07-30 09:06:03 -0400
commitfef1b84f0a587dc285af6659cb64042e34e54223 (patch)
treed48d46991210062fd797ac00d18a27f37837509f /Source/Core/DolphinQt/Debugger/CodeWidget.cpp
parentdea2b9c509b96cb58182b883c1df9f9f7f9234bf (diff)
DolphinQt: Replace QStringLiteral with alternatives where applicable
QStringLiterals generate a buffer so that during runtime there's very little cost to constructing a QString. However, this also means that duplicated strings cannot be optimized out into a single entry that gets referenced everywhere, taking up space in the binary. Rather than use QStringLiteral(""), we can just use QString{} (the default constructor) to signify the empty string. This gets rid of an unnecessary string buffer from being created, saving a tiny bit of space. While we're at it, we can just use the character overloads of particular functions when they're available instead of using a QString overload. The characters in this case are Latin-1 to begin with, so we can just specify the characters as QLatin1Char instances to use those overloads. These will automatically convert to QChar if needed, so this is safe.
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/CodeWidget.cpp')
-rw-r--r--Source/Core/DolphinQt/Debugger/CodeWidget.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
index def631f87e..d158af2793 100644
--- a/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/CodeWidget.cpp
@@ -314,9 +314,9 @@ void CodeWidget::UpdateCallstack()
void CodeWidget::UpdateSymbols()
{
- QString selection = m_symbols_list->selectedItems().isEmpty() ?
- QStringLiteral("") :
- m_symbols_list->selectedItems()[0]->text();
+ const QString selection = m_symbols_list->selectedItems().isEmpty() ?
+ QString{} :
+ m_symbols_list->selectedItems()[0]->text();
m_symbols_list->clear();
for (const auto& symbol : g_symbolDB.Symbols())