From ee35bdce8f6b08922b4c9e0c0c838e5f2c4a79ad Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 22 Feb 2021 22:38:43 +0200 Subject: Optimise string operations a bit - Use QString::arg(Args...) instead of .arg().arg() - Use QLatin1String for string comparisons, should be faster - Use QLatin1String::arg() for better readability - Add the comment dfaure suggested in the MR, to explain why it's '2%' then '%1' in a QString().arg().arg() NO_CHANGELOG --- src/gui/kconfiggui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/kconfiggui.cpp') diff --git a/src/gui/kconfiggui.cpp b/src/gui/kconfiggui.cpp index 938fbd93..cafe061d 100644 --- a/src/gui/kconfiggui.cpp +++ b/src/gui/kconfiggui.cpp @@ -13,7 +13,7 @@ static QString configName(const QString &id, const QString &key) { - return (QLatin1String("session/") + QGuiApplication::applicationName() + QLatin1Char('_') + id + QLatin1Char('_') + key); + return QLatin1String("session/%1_%2_%3").arg(QGuiApplication::applicationName(), id, key); } static KConfig *s_sessionConfig = nullptr; -- cgit v1.2.1