Skip to content

Commit a52553a

Browse files
committed
fix(avoidance): use lambda
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent e677db4 commit a52553a

File tree

1 file changed

+3
-7
lines changed
  • planning/behavior_path_avoidance_module/src

1 file changed

+3
-7
lines changed

planning/behavior_path_avoidance_module/src/utils.cpp

+3-7
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,9 @@ bool isNearEndOfShift(
340340
return false;
341341
}
342342

343-
for (const auto & lane : original_lanes) {
344-
if (within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon())) {
345-
return true;
346-
}
347-
}
348-
349-
return false;
343+
return std::any_of(original_lanes.begin(), original_lanes.end(), [&ego_pos](const auto & lane) {
344+
return within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon());
345+
});
350346
}
351347

352348
bool straddleRoadBound(

0 commit comments

Comments
 (0)