| if (point_list.size() > 1) |
| { w->distance_update(fstr, vis_dist, point_list[point_list.size()-2]); |
| // add HighwaySegment, if not first point |
| segment_list.push_back(newHighwaySegment(point_list[point_list.size()-2], w, this)); |
Segment length is computed twice here:
| double last_distance = distance_to(prev_w); |
| length = waypoint1->distance_to(waypoint2); |
Construct HighwaySegment first, then use stored length.
Delete Waypoint::distance_update and just include the relevant bits inline.
Could probably also be a decent benefit for Python.
DataProcessing/siteupdate/cplusplus/classes/Route/read_wpt.cpp
Lines 86 to 89 in 3c15c69
Segment length is computed twice here:
DataProcessing/siteupdate/cplusplus/classes/Waypoint/Waypoint.cpp
Line 367 in 3c15c69
DataProcessing/siteupdate/cplusplus/classes/HighwaySegment/HighwaySegment.cpp
Line 12 in 3c15c69
Construct HighwaySegment first, then use stored length.
Delete
Waypoint::distance_updateand just include the relevant bits inline.Could probably also be a decent benefit for Python.