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 | 2e2086f3f884487b4f456bd4b4c1e21f96987b59 (patch) | |
tree | d8863f9851929f98f51e3a934f8dff902ae3e3d4 /src/newgrf_engine.cpp | |
parent | 435d92044831a6f8b1cf8b6b2f355ec41a256651 (diff) | |
download | openttd-2e2086f3f884487b4f456bd4b4c1e21f96987b59.tar.xz |
(svn r14742) -Codechange: use SmallMap in two cases to reduce compilation time and binary size
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r-- | src/newgrf_engine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index 1f07ab663..3b950dc8a 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -28,8 +28,7 @@ #include "rail.h" #include "settings_type.h" #include "aircraft.h" -#include "core/smallvec_type.hpp" -#include <map> +#include "core/smallmap_type.hpp" int _traininfo_vehicle_pitch = 0; @@ -1093,7 +1092,7 @@ void AlterVehicleListOrder(EngineID engine, EngineID target) void CommitVehicleListOrderChanges() { /* List position to Engine map */ - typedef std::map<uint16, Engine*> ListPositionMap; + typedef SmallMap<uint16, Engine *, 16> ListPositionMap; ListPositionMap lptr_map; const ListOrderChange *end = _list_order_changes.End(); @@ -1120,7 +1119,8 @@ void CommitVehicleListOrderChanges() uint16 target_position = target_e->list_position; bool moving = false; - for (ListPositionMap::iterator it = lptr_map.begin(); it != lptr_map.end(); ++it) { + const ListPositionMap::Pair *end = lptr_map.End(); + for (ListPositionMap::Pair *it = lptr_map.Begin(); it != end; ++it) { if (it->first == target_position) moving = true; if (moving) it->second->list_position++; } @@ -1128,7 +1128,7 @@ void CommitVehicleListOrderChanges() source_e->list_position = target_position; } - lptr_map.clear(); + lptr_map.Clear(); } /* Clear out the queue */ |