1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 03:12:41 +01:00

Codechange: Use emplace_back instead of push_back. (#13855)

This commit is contained in:
Peter Nelson
2025-03-20 17:39:10 +00:00
committed by GitHub
parent b98a7ff303
commit 89948b941b
15 changed files with 25 additions and 31 deletions

View File

@@ -2248,7 +2248,7 @@ static const BaseStation *FindStationsNearby(TileArea ta, bool distant_join)
if (T::IsValidBaseStation(st) && !st->IsInUse() && st->owner == _local_company) {
/* Include only within station spread (yes, it is strictly less than) */
if (std::max(DistanceMax(ta.tile, st->xy), DistanceMax(TileAddXY(ta.tile, ta.w - 1, ta.h - 1), st->xy)) < _settings_game.station.station_spread) {
_deleted_stations_nearby.push_back({st->xy, st->index});
_deleted_stations_nearby.emplace_back(st->xy, st->index);
/* Add the station when it's within where we're going to build */
if (IsInsideBS(TileX(st->xy), TileX(ctx.tile), ctx.w) &&