From b774757ca6d8d880d79af97a96e0412c03ac4b85 Mon Sep 17 00:00:00 2001 From: Denis Levchenko Date: Fri, 21 Aug 2020 18:07:18 +0300 Subject: [PATCH] [generator] Use adaptive roads cache size --- generator/routing_index_generator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generator/routing_index_generator.cpp b/generator/routing_index_generator.cpp index 21ba8d5e48..4ffc727bbe 100644 --- a/generator/routing_index_generator.cpp +++ b/generator/routing_index_generator.cpp @@ -528,12 +528,13 @@ void FillWeights(string const & path, string const & mwmFile, string const & cou shared_ptr vehicleModel = routing::CarModelFactory(countryParentNameGetterFn).GetVehicleModelForCountry(country); - routing::IndexGraph graph(make_shared( - routing::GeometryLoader::CreateFromFile(mwmFile, vehicleModel)), - routing::EdgeEstimator::Create(routing::VehicleType::Car, *vehicleModel, - nullptr /* trafficStash */)); MwmValue mwmValue(LocalCountryFile(path, platform::CountryFile(country), 0 /* version */)); + uint32_t mwmNumRoads = DeserializeIndexGraphNumRoads(mwmValue, routing::VehicleType::Car); + routing::IndexGraph graph(make_shared( + routing::GeometryLoader::CreateFromFile(mwmFile, vehicleModel), mwmNumRoads), + routing::EdgeEstimator::Create(routing::VehicleType::Car, *vehicleModel, + nullptr /* trafficStash */)); DeserializeIndexGraph(mwmValue, routing::VehicleType::Car, graph); map> weights;