From 2e2086f3f884487b4f456bd4b4c1e21f96987b59 Mon Sep 17 00:00:00 2001 From: smatz Date: Fri, 26 Dec 2008 13:50:46 +0000 Subject: (svn r14742) -Codechange: use SmallMap in two cases to reduce compilation time and binary size --- src/town_cmd.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/town_cmd.cpp') 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 +#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 _town_test_ratings; +SmallMap _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::iterator it = _town_test_ratings.find(t); - if (it != _town_test_ratings.end()) { - return (*it).second; + SmallMap::iterator it = _town_test_ratings.Find(t); + if (it != _town_test_ratings.End()) { + return it->second; } } return t->ratings[_current_company]; -- cgit v1.2.3-54-g00ecf