Codechange: Replace station related FOR_ALL with range-based for loops

This commit is contained in:
glx
2019-12-15 05:55:59 +01:00
committed by Niels Martin Hansen
parent 3a14cea068
commit ddabfed1cd
27 changed files with 76 additions and 151 deletions

View File

@@ -1547,7 +1547,6 @@ void NetworkSocketHandler::SendCompanyInformation(Packet *p, const Company *c, c
void NetworkPopulateCompanyStats(NetworkCompanyStats *stats)
{
const Vehicle *v;
const Station *s;
memset(stats, 0, sizeof(*stats) * MAX_COMPANIES);
@@ -1566,7 +1565,7 @@ void NetworkPopulateCompanyStats(NetworkCompanyStats *stats)
}
/* Go through all stations and count the types of stations */
FOR_ALL_STATIONS(s) {
for (const Station *s : Station::Iterate()) {
if (Company::IsValidID(s->owner)) {
NetworkCompanyStats *npi = &stats[s->owner];