Skip to content

Commit

Permalink
move the cheap/fast check first to possibly boost performance
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Sanchez <[email protected]>
  • Loading branch information
danielsanchezaran committed Feb 27, 2024
1 parent 66d71a0 commit 127a293
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ PathWithLaneId LaneDepartureChecker::cropPointsOutsideOfLanes(
const auto vehicle_footprints = createVehicleFootprints(path);
size_t idx = 0;
std::for_each(vehicle_footprints.begin(), vehicle_footprints.end(), [&](const auto & footprint) {
if (boost::geometry::within(footprint, fused_lanelets_polygon.value()) || idx > end_index) {
if (idx > end_index || boost::geometry::within(footprint, fused_lanelets_polygon.value())) {
temp_path.points.push_back(path.points.at(idx));
}
++idx;
Expand Down

0 comments on commit 127a293

Please sign in to comment.