refactor: Fix clang-tidy modernize-return-braced-init-list

This commit is contained in:
Lars Toenning
2025-10-10 23:43:20 +02:00
parent 8f946b77d5
commit e09413614a
195 changed files with 724 additions and 690 deletions

View File

@@ -259,16 +259,16 @@ namespace swift::core
CGlobalSetup CApplication::getGlobalSetup() const
{
if (m_shutdown) { return CGlobalSetup(); }
if (m_shutdown) { return {}; }
const CSetupReader *r = m_setupReader.data();
if (!r) { return CGlobalSetup(); }
if (!r) { return {}; }
return r->getSetup();
}
CUpdateInfo CApplication::getUpdateInfo() const
{
if (m_shutdown) { return CUpdateInfo(); }
if (!m_gitHubPackagesReader) { return CUpdateInfo(); }
if (m_shutdown) { return {}; }
if (!m_gitHubPackagesReader) { return {}; }
return m_gitHubPackagesReader->getUpdateInfo();
}
@@ -412,7 +412,7 @@ namespace swift::core
CStatusMessage CApplication::initLocalSettings()
{
if (m_localSettingsLoaded) { return CStatusMessage(); }
if (m_localSettingsLoaded) { return {}; }
m_localSettingsLoaded = true;
// trigger loading and saving of settings in appropriate scenarios
@@ -427,7 +427,7 @@ namespace swift::core
// sent to swiftcore and saved by swiftcore.
CSettingsCache::instance()->enableLocalSave();
}
return CStatusMessage();
return {};
}
bool CApplication::hasUnsavedSettings() const { return !this->getUnsavedSettingsKeys().isEmpty(); }
@@ -442,7 +442,7 @@ namespace swift::core
CStatusMessage CApplication::saveSettingsByKey(const QStringList &keys)
{
if (keys.isEmpty()) { return CStatusMessage(); }
if (keys.isEmpty()) { return {}; }
return this->supportsContexts() ? this->getIContextApplication()->saveSettingsByKey(keys) :
CSettingsCache::instance()->saveToStore(keys);
}