summaryrefslogtreecommitdiff
path: root/src/bridge_gui.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/bridge_gui.cpp
parentca2f33c6d025c0c45fb4bc472493290445312de5 (diff)
downloadopenttd-a0f36a50e6324f570985f5010eb0543ec0673aeb.tar.xz
Codechange: Replaced SmallVector::Append() with std::vector::[push|emplace]_back()
Diffstat (limited to 'src/bridge_gui.cpp')
-rw-r--r--src/bridge_gui.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index bbb54551e..94b709c63 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -416,12 +416,13 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
if (CheckBridgeAvailability(brd_type, bridge_len).Succeeded()) {
/* bridge is accepted, add to list */
- BuildBridgeData *item = bl->Append();
- item->index = brd_type;
- item->spec = GetBridgeSpec(brd_type);
+ /*C++17: BuildBridgeData &item = */ bl->emplace_back();
+ BuildBridgeData &item = bl->back();
+ item.index = brd_type;
+ item.spec = GetBridgeSpec(brd_type);
/* Add to terraforming & bulldozing costs the cost of the
* bridge itself (not computed with DC_QUERY_COST) */
- item->cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item->spec->price) >> 8) + infra_cost;
+ item.cost = ret.GetCost() + (((int64)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item.spec->price) >> 8) + infra_cost;
}
}
}