1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-21 11:22:45 +01:00

Codechange: Emplace std::pair into vectors.

This creates the pair in the vector, instead of creating it then copying it in.
This commit is contained in:
Peter Nelson
2024-04-20 02:48:56 +01:00
committed by Peter Nelson
parent ed2db80990
commit 40fa45a76a
7 changed files with 8 additions and 8 deletions

View File

@@ -4225,9 +4225,9 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
}
if (used_stations.empty()) {
used_stations.reserve(2);
used_stations.emplace_back(std::make_pair(first_station, 0));
used_stations.emplace_back(first_station, 0);
}
used_stations.emplace_back(std::make_pair(st, 0));
used_stations.emplace_back(st, 0);
}
/* no stations around at all? */