1
0
Fork 0

Codechange: Use range-for to iterate airport specs to find first available.

pull/12867/head
Peter Nelson 2024-07-17 10:04:59 +01:00
parent a6572a2981
commit ed1922804c
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
1 changed files with 2 additions and 3 deletions

View File

@ -537,10 +537,9 @@ public:
{ {
/* First try to select an airport in the selected class. */ /* First try to select an airport in the selected class. */
AirportClass *sel_apclass = AirportClass::Get(_selected_airport_class); AirportClass *sel_apclass = AirportClass::Get(_selected_airport_class);
for (uint i = 0; i < sel_apclass->GetSpecCount(); i++) { for (const AirportSpec *as : sel_apclass->Specs()) {
const AirportSpec *as = sel_apclass->GetSpec(i);
if (as->IsAvailable()) { if (as->IsAvailable()) {
this->SelectOtherAirport(i); this->SelectOtherAirport(as->index);
return; return;
} }
} }