mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Use std::as_const (C++17 feature)
This commit is contained in:
@@ -443,7 +443,7 @@ namespace BlackSimPlugin
|
||||
int CSimConnectObjects::countConfirmedAdded()
|
||||
{
|
||||
int c = 0;
|
||||
for (const CSimConnectObject &simObject : as_const(*this))
|
||||
for (const CSimConnectObject &simObject : std::as_const(*this))
|
||||
{
|
||||
if (simObject.isConfirmedAdded()) { c++; }
|
||||
}
|
||||
@@ -542,7 +542,7 @@ namespace BlackSimPlugin
|
||||
CSimConnectObjects removedObjects;
|
||||
|
||||
const qint64 ts = QDateTime::currentMSecsSinceEpoch();
|
||||
for (const CSimConnectObject &simObject : as_const(*this))
|
||||
for (const CSimConnectObject &simObject : std::as_const(*this))
|
||||
{
|
||||
// verification takes at least a second, so we need some time before outdating
|
||||
if (type != CSimConnectObject::AllTypes && simObject.getType() != type) { continue; }
|
||||
|
||||
@@ -1205,7 +1205,7 @@ namespace BlackSimPlugin
|
||||
CSimulatedAircraftList toBeAddedAircraft; // aircraft still to be added
|
||||
CCallsignSet toBeRemovedCallsigns;
|
||||
|
||||
for (const CSimConnectObject &pendingSimObj : as_const(m_addPendingAircraft))
|
||||
for (const CSimConnectObject &pendingSimObj : std::as_const(m_addPendingAircraft))
|
||||
{
|
||||
BLACK_VERIFY_X(pendingSimObj.hasCallsign(), Q_FUNC_INFO, "missing callsign");
|
||||
if (!pendingSimObj.hasCallsign()) { continue; }
|
||||
|
||||
Reference in New Issue
Block a user