summaryrefslogtreecommitdiff
path: root/src/vehicle.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/vehicle.cpp
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 0e05d68f2..f1b727971 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2283,9 +2283,7 @@ void Vehicle::GetConsistFreeCapacities(SmallMap<CargoID, uint> &capacities) cons
if (v->cargo_cap == 0) continue;
SmallPair<CargoID, uint> *pair = capacities.Find(v->cargo_type);
if (pair == capacities.End()) {
- pair = capacities.Append();
- pair->first = v->cargo_type;
- pair->second = v->cargo_cap - v->cargo.StoredCount();
+ capacities.push_back({v->cargo_type, v->cargo_cap - v->cargo.StoredCount()});
} else {
pair->second += v->cargo_cap - v->cargo.StoredCount();
}