summaryrefslogtreecommitdiff
path: root/src/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/engine.cpp
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index b7be293af..7412ec639 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -490,11 +490,12 @@ void EngineOverrideManager::ResetToDefaultMapping()
this->clear();
for (VehicleType type = VEH_TRAIN; type <= VEH_AIRCRAFT; type++) {
for (uint internal_id = 0; internal_id < _engine_counts[type]; internal_id++) {
- EngineIDMapping *eid = this->Append();
- eid->type = type;
- eid->grfid = INVALID_GRFID;
- eid->internal_id = internal_id;
- eid->substitute_id = internal_id;
+ /*C++17: EngineIDMapping &eid = */ this->emplace_back();
+ EngineIDMapping &eid = this->back();
+ eid.type = type;
+ eid.grfid = INVALID_GRFID;
+ eid.internal_id = internal_id;
+ eid.substitute_id = internal_id;
}
}
}