Replace various uses of std::set/map with btree containers.

This commit is contained in:
Jonathan G Rennison
2017-02-08 00:18:09 +00:00
parent 76de8f9b13
commit 9d5f34fea6
10 changed files with 35 additions and 30 deletions

View File

@@ -3,11 +3,12 @@
#include "../stdafx.h"
#include "../core/math_func.hpp"
#include "mcf.h"
#include "../3rdparty/cpp-btree/btree_map.h"
#include <set>
#include "../safeguards.h"
typedef std::map<NodeID, Path *> PathViaMap;
typedef btree::btree_map<NodeID, Path *> PathViaMap;
/**
* This is a wrapper around Tannotation* which also stores a cache of GetAnnotation() and GetNode()

View File

@@ -14,9 +14,9 @@
#include "../cargo_type.h"
#include "../vehicle_base.h"
#include "../3rdparty/cpp-btree/btree_set.h"
#include <vector>
#include <map>
#include <set>
/**
* Utility to refresh links a consist will visit.
@@ -67,7 +67,7 @@ protected:
* Default constructor should not be called but has to be visible for
* usage in std::set.
*/
Hop() {NOT_REACHED();}
Hop() {}
/**
* Real constructor, only use this one.
@@ -80,7 +80,7 @@ protected:
};
typedef std::vector<RefitDesc> RefitList;
typedef std::set<Hop> HopSet;
typedef btree::btree_set<Hop> HopSet;
Vehicle *vehicle; ///< Vehicle for which the links should be refreshed.
uint capacities[NUM_CARGO]; ///< Current added capacities per cargo ID in the consist.