mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refactor: Fix clang-tidy modernize-return-braced-init-list
This commit is contained in:
@@ -255,10 +255,7 @@ namespace swift::core::context
|
||||
return CStatusMessage({ CLogCategories::validation() }, CStatusMessage::SeverityError,
|
||||
u"Invalid ICAO data for own aircraft");
|
||||
}
|
||||
if (!CNetworkUtils::canConnect(server, msg, 5000))
|
||||
{
|
||||
return CStatusMessage(CStatusMessage::SeverityError, msg);
|
||||
}
|
||||
if (!CNetworkUtils::canConnect(server, msg, 5000)) { return { CStatusMessage::SeverityError, msg }; }
|
||||
if (m_fsdClient->isConnected())
|
||||
{
|
||||
return CStatusMessage({ CLogCategories::validation() }, CStatusMessage::SeverityError,
|
||||
@@ -620,7 +617,7 @@ namespace swift::core::context
|
||||
CCallsignSet callsigns;
|
||||
callsigns.push_back(callsign);
|
||||
const CUserList users = this->getUsersForCallsigns(callsigns);
|
||||
if (users.isEmpty()) { return CUser(); }
|
||||
if (users.isEmpty()) { return {}; }
|
||||
return users[0];
|
||||
}
|
||||
|
||||
@@ -894,7 +891,7 @@ namespace swift::core::context
|
||||
|
||||
CAtcStationList CContextNetwork::getClosestAtcStationsOnline(int number) const
|
||||
{
|
||||
if (!this->getIContextOwnAircraft()) { return CAtcStationList(); }
|
||||
if (!this->getIContextOwnAircraft()) { return {}; }
|
||||
const CAircraftSituation ownSituation = this->getIContextOwnAircraft()->getOwnAircraftSituation();
|
||||
const CAtcStationList stations = m_airspace->getAtcStationsOnline().findClosest(number, ownSituation);
|
||||
return stations;
|
||||
@@ -1036,7 +1033,7 @@ namespace swift::core::context
|
||||
QString CContextNetwork::getNetworkStatistics(bool reset, const QString &separator)
|
||||
{
|
||||
if (this->isDebugEnabled()) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
if (!m_fsdClient) { return QString(); }
|
||||
if (!m_fsdClient) { return {}; }
|
||||
return m_fsdClient->getNetworkStatisticsAsText(reset, separator);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user