refactor: Fix clang-tidy modernize-loop-convert

This commit is contained in:
Lars Toenning
2025-10-11 20:27:46 +02:00
parent e09413614a
commit 4e6a6887f1
12 changed files with 25 additions and 34 deletions

View File

@@ -106,9 +106,8 @@ namespace swift::core::afv::audio
{
bool audioPlayed = false;
QVector<quint16> handledTransceiverIDs;
for (int i = 0; i < rxTransceiversFilteredAndSorted.size(); i++)
for (const auto rxTransceiver : rxTransceiversFilteredAndSorted)
{
const RxTransceiverDto rxTransceiver = rxTransceiversFilteredAndSorted[i];
if (!handledTransceiverIDs.contains(rxTransceiver.id))
{
handledTransceiverIDs.push_back(rxTransceiver.id);

View File

@@ -48,11 +48,11 @@ namespace swift::core::afv::model
QVector<CSampleAtcStation> transceivers;
QString callsign;
for (auto it = rootArray.begin(); it != rootArray.end(); ++it)
for (auto it : rootArray)
{
if (it->isObject())
if (it.isObject())
{
const QJsonObject stationObject = it->toObject();
const QJsonObject stationObject = it.toObject();
if (stationObject.contains("callsign")) { callsign = stationObject.value("callsign").toString(); }
@@ -61,9 +61,9 @@ namespace swift::core::afv::model
if (stationObject.contains("transceivers"))
{
QJsonArray txArray = stationObject.value("transceivers").toArray();
for (auto jt = txArray.begin(); jt != txArray.end(); ++jt)
for (auto &&jt : txArray)
{
const TransceiverDto transceiver = TransceiverDto::fromJson(jt->toObject());
const TransceiverDto transceiver = TransceiverDto::fromJson(jt.toObject());
transceivers.push_back({ callsign, transceiver });
}
}