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
path: root/openlr
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2019-04-24 12:49:32 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2019-04-26 11:38:45 +0300
commit3753df194ca2a485d90367aa94a14491578218ad (patch)
tree45dda5557df7ed595f2c1b1fa69583e2f6ec0f60 /openlr
parent75176e8c0f2d304ce0665fde39b8e6d6670219f6 (diff)
Review fixes.
Diffstat (limited to 'openlr')
-rw-r--r--openlr/score_candidate_paths_getter.cpp5
-rw-r--r--openlr/score_paths_connector.cpp16
-rw-r--r--openlr/score_types.hpp5
3 files changed, 13 insertions, 13 deletions
diff --git a/openlr/score_candidate_paths_getter.cpp b/openlr/score_candidate_paths_getter.cpp
index f8f1619781..f06e579649 100644
--- a/openlr/score_candidate_paths_getter.cpp
+++ b/openlr/score_candidate_paths_getter.cpp
@@ -180,9 +180,8 @@ void ScoreCandidatePathsGetter::GetAllSuitablePaths(ScoreEdgeVec const & startLi
// Road score for a path is minimum value of score of segments based on functional road class
// of the segments and form of way of the segments.
- auto const p = make_shared<Link>(u, e, u->m_distanceM + currentEdgeLen, u->m_pointScore,
- min(roadScore, u->m_minRoadScore));
- q.emplace(p);
+ q.emplace(make_shared<Link>(u, e, u->m_distanceM + currentEdgeLen, u->m_pointScore,
+ min(roadScore, u->m_minRoadScore)));
}
}
}
diff --git a/openlr/score_paths_connector.cpp b/openlr/score_paths_connector.cpp
index a84cc36808..c3fbe54a1c 100644
--- a/openlr/score_paths_connector.cpp
+++ b/openlr/score_paths_connector.cpp
@@ -211,7 +211,7 @@ bool ScorePathsConnector::FindShortestPath(Graph::Edge const & from, Graph::Edge
bool operator>(State const & o) const
{
- return make_tuple(m_score, m_edge) > make_tuple(o.m_score, o.m_edge);
+ return tie(m_score, m_edge) > tie(o.m_score, o.m_edge);
}
Graph::Edge m_edge;
@@ -287,8 +287,9 @@ bool ScorePathsConnector::ConnectAdjacentCandidateLines(Graph::EdgeVector const
{
if (skip == -1)
return false;
- copy(begin(from), end(from), back_inserter(resultPath));
- copy(begin(to) + skip, end(to), back_inserter(resultPath));
+
+ resultPath.insert(resultPath.end(), from.cbegin(), from.cend());
+ resultPath.insert(resultPath.end(), to.cbegin() + skip, to.cend());
return true;
}
@@ -302,12 +303,13 @@ bool ScorePathsConnector::ConnectAdjacentCandidateLines(Graph::EdgeVector const
return false;
// Skip the last edge from |from| because it already took its place at begin(shortestPath).
- copy(begin(from), prev(end(from)), back_inserter(resultPath));
- copy(begin(shortestPath), end(shortestPath), back_inserter(resultPath));
+ resultPath.insert(resultPath.end(), from.cbegin(), prev(from.cend()));
+ resultPath.insert(resultPath.end(), shortestPath.cbegin(), shortestPath.cend());
+
// Skip the first edge from |to| because it already took its place at prev(end(shortestPath)).
- copy(next(begin(to)), end(to), back_inserter(resultPath));
+ resultPath.insert(resultPath.end(), next(to.begin()), to.end());
- return found && !resultPath.empty();
+ return !resultPath.empty();
}
Score ScorePathsConnector::GetScoreForUniformity(Graph::EdgeVector const & path)
diff --git a/openlr/score_types.hpp b/openlr/score_types.hpp
index 041f34e576..128dbdef3d 100644
--- a/openlr/score_types.hpp
+++ b/openlr/score_types.hpp
@@ -5,6 +5,7 @@
#include "geometry/point2d.hpp"
#include <cstdint>
+#include <tuple>
#include <vector>
namespace openlr
@@ -21,9 +22,7 @@ struct ScorePoint
bool operator<(ScorePoint const & o) const
{
- if (m_score != o.m_score)
- return m_score < o.m_score;
- return m_point < o.m_point;
+ return std::tie(m_score, m_point) < std::tie(o.m_score, o.m_point);
}
bool operator==(ScorePoint const & o) const