forked from organicmaps/organicmaps
[routing] remove template without bug
This commit is contained in:
parent
b166754ecf
commit
8a2e3eafa9
1 changed files with 10 additions and 3 deletions
|
@ -33,8 +33,10 @@
|
|||
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <sys/resource.h>
|
||||
#include <tuple>
|
||||
|
||||
using namespace routing;
|
||||
using namespace routing_test;
|
||||
|
@ -149,9 +151,14 @@ shared_ptr<VehicleRouterComponents> CreateAllMapsComponents(VehicleType vehicleT
|
|||
|
||||
IRouterComponents & GetVehicleComponents(VehicleType vehicleType)
|
||||
{
|
||||
static auto const instance = CreateAllMapsComponents(vehicleType);
|
||||
ASSERT(instance, ());
|
||||
return *instance;
|
||||
static map<VehicleType, shared_ptr<VehicleRouterComponents>> kVehicleComponents;
|
||||
|
||||
auto it = kVehicleComponents.find(vehicleType);
|
||||
if (it == kVehicleComponents.end())
|
||||
tie(it, ignore) = kVehicleComponents.emplace(vehicleType, CreateAllMapsComponents(vehicleType));
|
||||
|
||||
CHECK(it->second, ());
|
||||
return *(it->second);
|
||||
}
|
||||
|
||||
TRouteResult CalculateRoute(IRouterComponents const & routerComponents,
|
||||
|
|
Loading…
Add table
Reference in a new issue