Skip to content

Commit

Permalink
Enable RVO (return value optimization).
Browse files Browse the repository at this point in the history
Signed-off-by: Camila Ayres <[email protected]>
  • Loading branch information
camilasan committed Jul 3, 2024
1 parent 11a0874 commit 0b87344
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0b87344

Please sign in to comment.