Skip to content

redundant segment length computation #240

Closed
TravelMapping/DataProcessing
#607

Description

@yakra

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(new HighwaySegment(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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions