[routing] Passing Maxspeed by value.

This commit is contained in:
Vladimir Byko-Ianko 2018-12-07 09:13:45 +03:00
parent 957443418e
commit fcb9ca69c0
2 changed files with 4 additions and 4 deletions

View file

@ -177,8 +177,7 @@ VehicleModel::SpeedKMpH VehicleModel::GetTypeSpeed(feature::TypesHolder const &
VehicleModel::SpeedKMpH VehicleModel::GetSpeedWihtoutMaxspeed(FeatureType & f,
SpeedParams const & speedParams) const
{
SpeedParams const withoutMaxspeed(speedParams.m_forward, speedParams.m_inCity, Maxspeed());
return VehicleModel::GetSpeed(f, withoutMaxspeed);
return VehicleModel::GetSpeed(f, {speedParams.m_forward, speedParams.m_inCity, Maxspeed()});
}
bool VehicleModel::IsOneWay(FeatureType & f) const

View file

@ -9,6 +9,7 @@
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
class Classificator;
@ -21,8 +22,8 @@ namespace routing
/// \brief Params for calculation of an approximate speed on a feature.
struct SpeedParams
{
SpeedParams(bool forward, bool inCity, Maxspeed const & maxspeed)
: m_forward(forward), m_inCity(inCity), m_maxspeed(maxspeed)
SpeedParams(bool forward, bool inCity, Maxspeed maxspeed)
: m_forward(forward), m_inCity(inCity), m_maxspeed(std::move(maxspeed))
{
}