Skip to content

Commit 2114b0e

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

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
@@ -343,13 +343,9 @@ bool isNearEndOfShift(
343343
return false;
344344
}
345345

346-
for (const auto & lane : original_lanes) {
347-
if (within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon())) {
348-
return true;
349-
}
350-
}
351-
352-
return false;
346+
return std::any_of(original_lanes.begin(), original_lanes.end(), [&ego_pos](const auto & lane) {
347+
return within(to2D(toLaneletPoint(ego_pos)), lane.polygon2d().basicPolygon());
348+
});
353349
}
354350

355351
bool straddleRoadBound(

0 commit comments

Comments
 (0)