diff --git a/src/station.cpp b/src/station.cpp index 737a37de4e..f323dff5a2 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -8,6 +8,7 @@ /** @file station.cpp Implementation of the station base class. */ #include "stdafx.h" +#include "core/flatset_type.hpp" #include "company_func.h" #include "company_base.h" #include "roadveh.h" @@ -425,8 +426,8 @@ void Station::RemoveIndustryToDeliver(Industry *ind) */ void Station::RemoveFromAllNearbyLists() { - std::set towns; - std::set industries; + FlatSet towns; + FlatSet industries; for (const auto &tile : this->catchment_tiles) { TileType type = GetTileType(tile); diff --git a/src/station_base.h b/src/station_base.h index 91189baa49..c503118f9e 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -10,6 +10,7 @@ #ifndef STATION_BASE_H #define STATION_BASE_H +#include "core/flatset_type.hpp" #include "core/random_func.hpp" #include "base_station_base.h" #include "newgrf_airport.h" @@ -627,14 +628,15 @@ void ForAllStationsAroundTiles(const TileArea &ta, Func func) if (Station::GetNumItems() == 0) return; /* Not using, or don't have a nearby stations list, so we need to scan. */ - std::set seen_stations; + FlatSet seen_stations; /* Scan an area around the building covering the maximum possible station * to find the possible nearby stations. */ uint max_c = _settings_game.station.modified_catchment ? MAX_CATCHMENT : CA_UNMODIFIED; TileArea ta_ext = TileArea(ta).Expand(max_c); for (TileIndex tile : ta_ext) { - if (IsTileType(tile, MP_STATION)) seen_stations.insert(GetStationIndex(tile)); + if (!IsTileType(tile, MP_STATION)) continue; + seen_stations.insert(GetStationIndex(tile)); } for (StationID stationid : seen_stations) { diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 0e93152019..72152ba5d1 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -8,6 +8,7 @@ /** @file station_cmd.cpp Handling of station tiles. */ #include "stdafx.h" +#include "core/flatset_type.hpp" #include "aircraft.h" #include "bridge_map.h" #include "vehiclelist_func.h" @@ -543,7 +544,7 @@ static void ShowRejectOrAcceptNews(const Station *st, CargoTypes cargoes, bool r CargoArray GetProductionAroundTiles(TileIndex north_tile, int w, int h, int rad) { CargoArray produced{}; - std::set industries; + FlatSet industries; TileArea ta = TileArea(north_tile, w, h).Expand(rad); /* Loop over all tiles to get the produced cargo of