Use btree_set for IndustryList and StationList

This commit is contained in:
Jonathan G Rennison
2019-03-13 02:49:35 +00:00
parent 5e6d283463
commit 290471c70f
3 changed files with 5 additions and 5 deletions

View File

@@ -20,10 +20,10 @@
#include "linkgraph/linkgraph_type.h" #include "linkgraph/linkgraph_type.h"
#include "newgrf_storage.h" #include "newgrf_storage.h"
#include "3rdparty/cpp-btree/btree_map.h" #include "3rdparty/cpp-btree/btree_map.h"
#include "3rdparty/cpp-btree/btree_set.h"
#include "bitmap_type.h" #include "bitmap_type.h"
#include <map> #include <map>
#include <vector> #include <vector>
#include <set>
typedef Pool<BaseStation, StationID, 32, 64000> StationPool; typedef Pool<BaseStation, StationID, 32, 64000> StationPool;
extern StationPool _station_pool; extern StationPool _station_pool;
@@ -451,7 +451,7 @@ struct IndustryCompare {
bool operator() (const Industry *lhs, const Industry *rhs) const; bool operator() (const Industry *lhs, const Industry *rhs) const;
}; };
typedef std::set<Industry *, IndustryCompare> IndustryList; typedef btree::btree_set<Industry *, IndustryCompare> IndustryList;
/** Station data structure */ /** Station data structure */
struct Station FINAL : SpecializedStation<Station, false> { struct Station FINAL : SpecializedStation<Station, false> {

View File

@@ -4068,7 +4068,7 @@ void FindStationsAroundTiles(const TileArea &location, StationList *stations, bo
uint x = TileX(location.tile); uint x = TileX(location.tile);
uint y = TileY(location.tile); uint y = TileY(location.tile);
std::set<StationID> seen_stations; btree::btree_set<StationID> seen_stations;
/* Scan an area around the building covering the maximum possible station /* Scan an area around the building covering the maximum possible station
* to find the possible nearby stations. */ * to find the possible nearby stations. */

View File

@@ -14,7 +14,7 @@
#include "core/smallstack_type.hpp" #include "core/smallstack_type.hpp"
#include "tilearea_type.h" #include "tilearea_type.h"
#include <set> #include "3rdparty/cpp-btree/btree_set.h"
typedef uint16 StationID; typedef uint16 StationID;
typedef uint16 RoadStopID; typedef uint16 RoadStopID;
@@ -97,7 +97,7 @@ struct StationCompare {
}; };
/** List of stations */ /** List of stations */
typedef std::set<Station *, StationCompare> StationList; typedef btree::btree_set<Station *, StationCompare> StationList;
/** /**
* Structure contains cached list of stations nearby. The list * Structure contains cached list of stations nearby. The list