1
0
Fork 0

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

pull/12864/head
Peter Nelson 2024-07-17 10:04:59 +01:00
parent 7910331443
commit 083ff0421d
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. */
AirportClass *sel_apclass = AirportClass::Get(_selected_airport_class);
for (uint i = 0; i < sel_apclass->GetSpecCount(); i++) {
const AirportSpec *as = sel_apclass->GetSpec(i);
for (const AirportSpec *as : sel_apclass->Specs()) {
if (as->IsAvailable()) {
this->SelectOtherAirport(i);
this->SelectOtherAirport(as->index);
return;
}
}