Codechange: Use std::map instead of custom SmallMap.

This commit is contained in:
2023-05-16 20:50:41 +01:00
committed by PeterN
parent 72018badff
commit c38df2d589
30 changed files with 81 additions and 235 deletions

View File

@@ -3645,7 +3645,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold)
}
static bool _town_rating_test = false; ///< If \c true, town rating is in test-mode.
static SmallMap<const Town *, int> _town_test_ratings; ///< Map of towns to modified ratings, while in town rating test-mode.
static std::map<const Town *, int> _town_test_ratings; ///< Map of towns to modified ratings, while in town rating test-mode.
/**
* Switch the town rating to test-mode, to allow commands to be tested without affecting current ratings.
@@ -3675,8 +3675,8 @@ void SetTownRatingTestMode(bool mode)
static int GetRating(const Town *t)
{
if (_town_rating_test) {
SmallMap<const Town *, int>::iterator it = _town_test_ratings.Find(t);
if (it != _town_test_ratings.End()) {
auto it = _town_test_ratings.find(t);
if (it != _town_test_ratings.end()) {
return it->second;
}
}