Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2018-12-07 09:13:45 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2018-12-07 11:05:01 +0300
commitfcb9ca69c06f3a998eccdfa75c945c0afbd204cd (patch)
tree2fae4e142bb4534398b5692a7484a0901766abde /routing_common
parent957443418e1863c044b8810fece77cd8f8a7dcde (diff)
[routing] Passing Maxspeed by value.
Diffstat (limited to 'routing_common')
-rw-r--r--routing_common/vehicle_model.cpp3
-rw-r--r--routing_common/vehicle_model.hpp5
2 files changed, 4 insertions, 4 deletions
diff --git a/routing_common/vehicle_model.cpp b/routing_common/vehicle_model.cpp
index 2302a4f7a4..f4ea9d6539 100644
--- a/routing_common/vehicle_model.cpp
+++ b/routing_common/vehicle_model.cpp
@@ -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
diff --git a/routing_common/vehicle_model.hpp b/routing_common/vehicle_model.hpp
index fa68464422..644d9823c7 100644
--- a/routing_common/vehicle_model.hpp
+++ b/routing_common/vehicle_model.hpp
@@ -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))
{
}