diff --git a/src/sl/station_sl.cpp b/src/sl/station_sl.cpp index cc1c9f3c65..4c9ed072a9 100644 --- a/src/sl/station_sl.cpp +++ b/src/sl/station_sl.cpp @@ -646,6 +646,7 @@ static void Load_STNN() SlObjectLoadFiltered(&st->goods[i], _filtered_goods_desc); StationID prev_source = INVALID_STATION; if (SlXvIsFeaturePresent(XSLFI_FLOW_STAT_FLAGS)) { + st->goods[i].flows.reserve(_num_flows); for (uint32 j = 0; j < _num_flows; ++j) { FlowSaveLoad flow; buffer->CheckBytes(2 + 4); diff --git a/src/station_base.h b/src/station_base.h index f671f62ca2..50dbf15f19 100644 --- a/src/station_base.h +++ b/src/station_base.h @@ -493,6 +493,11 @@ public: return this->flows_index.begin()->first; } + void reserve(size_t size) + { + this->flows_storage.reserve(size); + } + void SortStorage(); };