summaryrefslogtreecommitdiff
path: root/src/newgrf_engine.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-02-18 22:39:06 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commita0f36a50e6324f570985f5010eb0543ec0673aeb (patch)
tree09f9c9abd097acc244f80366da42cb8702c7ed19 /src/newgrf_engine.cpp
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/newgrf_engine.cpp')
-rw-r--r--src/newgrf_engine.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp
index 07e0f8af7..b2dd4d1a3 100644
--- a/src/newgrf_engine.cpp
+++ b/src/newgrf_engine.cpp
@@ -1196,9 +1196,7 @@ static SmallVector<ListOrderChange, 16> _list_order_changes;
void AlterVehicleListOrder(EngineID engine, uint target)
{
/* Add the list order change to a queue */
- ListOrderChange *loc = _list_order_changes.Append();
- loc->engine = engine;
- loc->target = target;
+ _list_order_changes.push_back({engine, target});
}
/**
@@ -1231,7 +1229,7 @@ void CommitVehicleListOrderChanges()
SmallVector<EngineID, 16> ordering;
Engine *e;
FOR_ALL_ENGINES(e) {
- *ordering.Append() = e->index;
+ ordering.push_back(e->index);
}
QSortT(ordering.Begin(), ordering.size(), EnginePreSort);