From 25f598cdc760e96af89310a5f36accf9402dfd24 Mon Sep 17 00:00:00 2001 From: Henry Wilson Date: Sat, 30 Dec 2017 22:51:14 +0000 Subject: [PATCH 06/31] CheckSubsidised()::towns_near ~> std::vector --- src/subsidy.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/subsidy.cpp b/src/subsidy.cpp index 62b463ced..1e85f0bb8 100644 --- a/src/subsidy.cpp +++ b/src/subsidy.cpp @@ -561,7 +561,7 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type, /* Remember all towns near this station (at least one house in its catchment radius) * which are destination of subsidised path. Do that only if needed */ - SmallVector towns_near; + std::vector towns_near; if (!st->rect.IsEmpty()) { Subsidy *s; FOR_ALL_SUBSIDIES(s) { @@ -577,7 +577,7 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type, TileIndex tile = TileXY(x, y); if (!IsTileType(tile, MP_HOUSE)) continue; const Town *t = Town::GetByTile(tile); - if (t->cache.part_of_subsidy & POS_DST) towns_near.Include(t); + if (t->cache.part_of_subsidy & POS_DST) Include(towns_near, t); } } break; @@ -602,9 +602,9 @@ bool CheckSubsidised(CargoID cargo_type, CompanyID company, SourceType src_type, } break; case ST_TOWN: - for (const Town * const *tp = towns_near.Begin(); tp != towns_near.End(); tp++) { - if (s->dst == (*tp)->index) { - assert((*tp)->cache.part_of_subsidy & POS_DST); + for (auto &tp : towns_near) { + if (s->dst == tp->index) { + assert(tp->cache.part_of_subsidy & POS_DST); subsidised = true; if (!s->IsAwarded()) s->AwardTo(company); } -- 2.14.1