diff options
author | smatz <smatz@openttd.org> | 2008-12-26 13:50:46 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-12-26 13:50:46 +0000 |
commit | bd92143e7bbf9f48008da45fe2c40857f84c3e5c (patch) | |
tree | d8863f9851929f98f51e3a934f8dff902ae3e3d4 /src/town_cmd.cpp | |
parent | 4ced1d3e9f5b655327256ad1cd6f6c17d2095228 (diff) | |
download | openttd-bd92143e7bbf9f48008da45fe2c40857f84c3e5c.tar.xz |
(svn r14742) -Codechange: use SmallMap in two cases to reduce compilation time and binary size
Diffstat (limited to 'src/town_cmd.cpp')
-rw-r--r-- | src/town_cmd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index de3531557..f660b2fe4 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -48,7 +48,7 @@ #include "functions.h" #include "animated_tile_func.h" #include "date_func.h" -#include <map> +#include "core/smallmap_type.hpp" #include "table/strings.h" #include "table/sprites.h" @@ -2504,14 +2504,14 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold) } static bool _town_rating_test = false; -std::map<const Town *, int> _town_test_ratings; +SmallMap<const Town *, int, 4> _town_test_ratings; void SetTownRatingTestMode(bool mode) { static int ref_count = 0; if (mode) { if (ref_count == 0) { - _town_test_ratings.clear(); + _town_test_ratings.Clear(); } ref_count++; } else { @@ -2524,9 +2524,9 @@ void SetTownRatingTestMode(bool mode) static int GetRating(const Town *t) { if (_town_rating_test) { - std::map<const Town *, int>::iterator it = _town_test_ratings.find(t); - if (it != _town_test_ratings.end()) { - return (*it).second; + SmallMap<const Town *, int>::iterator it = _town_test_ratings.Find(t); + if (it != _town_test_ratings.End()) { + return it->second; } } return t->ratings[_current_company]; |