Skip to content

Commit 0f9adab

Browse files
committed
refactor: remove unused RefLine::road_id, avoid duplicated data, no behaviour tied to it
1 parent 99f6111 commit 0f9adab

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

include/RefLine.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace odr
1313

1414
struct RefLine
1515
{
16-
RefLine(std::string road_id, double length);
16+
RefLine(double length);
1717
RefLine(const RefLine& other);
1818

1919
std::set<const RoadGeometry*> get_geometries() const;
@@ -29,7 +29,6 @@ struct RefLine
2929
double match(const double x, const double y) const;
3030
std::set<double> approximate_linear(const double eps, const double s_start, const double s_end) const;
3131

32-
std::string road_id = "";
3332
double length = 0;
3433
CubicSpline elevation_profile;
3534

src/RefLine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace odr
1515
{
16-
RefLine::RefLine(std::string road_id, double length) : road_id(road_id), length(length) {}
16+
RefLine::RefLine(double length) : length(length) {}
1717

18-
RefLine::RefLine(const RefLine& other) : road_id(other.road_id), length(other.length), elevation_profile(other.elevation_profile)
18+
RefLine::RefLine(const RefLine& other) : length(other.length), elevation_profile(other.elevation_profile)
1919
{
2020
for (const auto& s0_geometry : other.s0_to_geometry)
2121
this->s0_to_geometry.emplace(s0_geometry.first, s0_geometry.second->clone());

src/Road.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ std::vector<RoadSignal> Road::get_road_signals() const
6565
}
6666

6767
Road::Road(std::string id, double length, std::string junction, std::string name, bool left_hand_traffic) :
68-
length(length), id(id), junction(junction), name(name), left_hand_traffic(left_hand_traffic), ref_line(id, length)
68+
length(length), id(id), junction(junction), name(name), left_hand_traffic(left_hand_traffic), ref_line(length)
6969
{
7070
}
7171

0 commit comments

Comments
 (0)