mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-11 06:25:33 +08:00
Use std::as_const (C++17 feature)
This commit is contained in:
@@ -371,7 +371,7 @@ namespace BlackCore
|
||||
myAircraft.getHeading().normalizedTo360Degrees().value(CAngleUnit::deg()),
|
||||
myAircraft.getParts().isOnGround());
|
||||
|
||||
for (const auto &receiver : as_const(m_interimPositionReceivers))
|
||||
for (const auto &receiver : std::as_const(m_interimPositionReceivers))
|
||||
{
|
||||
interimPilotDataUpdate.setReceiver(receiver.asString());
|
||||
sendQueudedMessage(interimPilotDataUpdate);
|
||||
@@ -1774,7 +1774,7 @@ namespace BlackCore
|
||||
{
|
||||
emit atisLogoffTimeReplyReceived(sender, message);
|
||||
CInformationMessage atisMessage(CInformationMessage::ATIS);
|
||||
for (const auto &line : as_const(pendingQuery.m_atisMessage))
|
||||
for (const auto &line : std::as_const(pendingQuery.m_atisMessage))
|
||||
{
|
||||
if (!atisMessage.isEmpty()) atisMessage.appendMessage("\n");
|
||||
atisMessage.appendMessage(line);
|
||||
@@ -1871,7 +1871,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
if (callStatistics.isEmpty()) { return QString(); }
|
||||
for (const auto [key, value] : makePairsRange(as_const(callStatistics)))
|
||||
for (const auto [key, value] : makePairsRange(std::as_const(callStatistics)))
|
||||
{
|
||||
// key is pair.first, value is pair.second
|
||||
transformed.push_back({ value, key });
|
||||
@@ -1975,7 +1975,7 @@ namespace BlackCore
|
||||
if (m_printToConsole) { qDebug() << "FSD Recv=>" << line; }
|
||||
emitRawFsdMessage(line, false);
|
||||
|
||||
for (const QString &str : makeKeysRange(as_const(m_messageTypeMapping)))
|
||||
for (const QString &str : makeKeysRange(std::as_const(m_messageTypeMapping)))
|
||||
{
|
||||
if (line.startsWith(str))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user