From 4de310738309b8b61c9495674f00966fd968689a Mon Sep 17 00:00:00 2001 From: Camila Ayres Date: Wed, 3 Jul 2024 16:23:33 +0200 Subject: [PATCH] Enable RVO (return value optimization). Signed-off-by: Camila Ayres --- src/libsync/configfile.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsync/configfile.cpp b/src/libsync/configfile.cpp index 01e8df7af973..59629f91caec 100644 --- a/src/libsync/configfile.cpp +++ b/src/libsync/configfile.cpp @@ -705,14 +705,15 @@ QString ConfigFile::defaultUpdateChannel() const QString ConfigFile::currentUpdateChannel() const { + auto updateChannel = defaultUpdateChannel(); QSettings settings(configFile(), QSettings::IniFormat); - if (const auto configUpdateChannel = settings.value(QLatin1String(updateChannelC), defaultUpdateChannel()).toString(); + if (const auto configUpdateChannel = settings.value(QLatin1String(updateChannelC), updateChannel).toString(); validUpdateChannels().contains(configUpdateChannel)) { qCWarning(lcConfigFile()) << "Config file has a valid update channel:" << configUpdateChannel; - return configUpdateChannel; + updateChannel = configUpdateChannel; } - return defaultUpdateChannel(); + return updateChannel; } void ConfigFile::setUpdateChannel(const QString &channel)