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:
committed by
Peter Nelson
parent
ed2db80990
commit
40fa45a76a
@@ -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? */
|
||||
|
||||
Reference in New Issue
Block a user