Use insert hints for station flow/share map insertion

This commit is contained in:
Jonathan G Rennison
2019-09-23 18:46:43 +01:00
parent 725ff47267
commit 1391f8fc59
2 changed files with 3 additions and 2 deletions

View File

@@ -585,7 +585,7 @@ static void Load_STNN()
if (!IsSavegameVersionBefore(SLV_187)) flow.restricted = (buffer->ReadByte() != 0);
if (fs == nullptr || prev_source != flow.source) {
fs = &(st->goods[i].flows.insert(std::make_pair(flow.source, FlowStat(flow.via, flow.share, flow.restricted))).first->second);
fs = &(st->goods[i].flows.insert(st->goods[i].flows.end(), std::make_pair(flow.source, FlowStat(flow.via, flow.share, flow.restricted)))->second);
} else {
fs->AppendShare(flow.via, flow.share, flow.restricted);
}