mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Use std::as_const (C++17 feature)
This commit is contained in:
@@ -1572,7 +1572,7 @@ namespace BlackMisc
|
||||
)
|
||||
);
|
||||
|
||||
for (const CAircraftModel &model : as_const(sorted))
|
||||
for (const CAircraftModel &model : std::as_const(sorted))
|
||||
{
|
||||
if (wasStopped) { break; } // allow breaking from external
|
||||
bool ok = false;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackMisc
|
||||
CAircraftModelList sortedByAircraft(models);
|
||||
sortedByAircraft.sortBy(&CAircraftModel::getAircraftIcaoCodeDesignator);
|
||||
|
||||
for (const CAircraftModel &model : as_const(sortedByAircraft))
|
||||
for (const CAircraftModel &model : std::as_const(sortedByAircraft))
|
||||
{
|
||||
const QString aircraftIcao(model.hasAircraftDesignator() ? model.getAircraftIcaoCodeDesignator() : emptyDesignator);
|
||||
if (!modelsByDesignator.contains(aircraftIcao))
|
||||
@@ -81,7 +81,7 @@ namespace BlackMisc
|
||||
// header
|
||||
html += "<thead><tr>\n"
|
||||
"<th></th>";
|
||||
for (const QString &airline : as_const(airlineIcaos))
|
||||
for (const QString &airline : std::as_const(airlineIcaos))
|
||||
{
|
||||
html += "<th>";
|
||||
html += airline;
|
||||
@@ -91,7 +91,7 @@ namespace BlackMisc
|
||||
"<tbody>\n";
|
||||
|
||||
// fill data
|
||||
for (const QString &aircraftIcao : as_const(aircraftIcaos))
|
||||
for (const QString &aircraftIcao : std::as_const(aircraftIcaos))
|
||||
{
|
||||
html += "<tr>\n"
|
||||
" <th>";
|
||||
@@ -99,7 +99,7 @@ namespace BlackMisc
|
||||
html += "</th>\n";
|
||||
|
||||
const QMap<QString, CAircraftModelList> &airlineModels = modelsByDesignator[aircraftIcao];
|
||||
for (const QString &airline : as_const(airlineIcaos))
|
||||
for (const QString &airline : std::as_const(airlineIcaos))
|
||||
{
|
||||
if (airlineModels.contains(airline))
|
||||
{
|
||||
|
||||
@@ -389,7 +389,7 @@ namespace BlackMisc
|
||||
Q_ASSERT_X(fileTimestamp.isValid(), Q_FUNC_INFO, "Missing file timestamp");
|
||||
|
||||
CAircraftCfgEntriesList result;
|
||||
for (const CAircraftCfgEntries &e : as_const(tempEntries))
|
||||
for (const CAircraftCfgEntries &e : std::as_const(tempEntries))
|
||||
{
|
||||
if (e.getTitle().isEmpty())
|
||||
{
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace BlackMisc
|
||||
file.close();
|
||||
parseFullPackage(content, package);
|
||||
|
||||
for (const auto &plane : as_const(package.planes))
|
||||
for (const auto &plane : std::as_const(package.planes))
|
||||
{
|
||||
if (installedModels.containsModelString(plane.getModelName()))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user