Skip to content

Commit

Permalink
fix(avoidance): use lambda
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota committed Feb 26, 2024
1 parent e677db4 commit a52553a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions planning/behavior_path_avoidance_module/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,9 @@ bool isNearEndOfShift(
return false;
}

for (const auto & lane : original_lanes) {
if (within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon())) {
return true;
}
}

return false;
return std::any_of(original_lanes.begin(), original_lanes.end(), [&ego_pos](const auto & lane) {
return within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon());
});
}

bool straddleRoadBound(
Expand Down

0 comments on commit a52553a

Please sign in to comment.