Skip to content

Commit 0b87344

Browse files
committed
Enable RVO (return value optimization).
Signed-off-by: Camila Ayres <[email protected]>
1 parent 11a0874 commit 0b87344

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/libsync/configfile.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,14 +705,15 @@ QString ConfigFile::defaultUpdateChannel() const
705705

706706
QString ConfigFile::currentUpdateChannel() const
707707
{
708+
auto updateChannel = defaultUpdateChannel();
708709
QSettings settings(configFile(), QSettings::IniFormat);
709-
if (const auto configUpdateChannel = settings.value(QLatin1String(updateChannelC), defaultUpdateChannel()).toString();
710+
if (const auto configUpdateChannel = settings.value(QLatin1String(updateChannelC), updateChannel).toString();
710711
validUpdateChannels().contains(configUpdateChannel)) {
711712
qCWarning(lcConfigFile()) << "Config file has a valid update channel:" << configUpdateChannel;
712-
return configUpdateChannel;
713+
updateChannel = configUpdateChannel;
713714
}
714715

715-
return defaultUpdateChannel();
716+
return updateChannel;
716717
}
717718

718719
void ConfigFile::setUpdateChannel(const QString &channel)

0 commit comments

Comments
 (0)