Skip to content

Commit 869cf4c

Browse files
authored
fix(autoware_behavior_velocity_intersection_module): fix bugprone-branch-clone (#9702)
fix: bugprone-error Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
1 parent 2035873 commit 869cf4c

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

planning/behavior_velocity_planner/autoware_behavior_velocity_intersection_module/src/scene_intersection.cpp

+2-9
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,7 @@ DecisionResult IntersectionModule::modifyPathVelocityDetail(PathWithLaneId * pat
354354
(std::fabs(dist_stopline) < planner_param_.common.stopline_overshoot_margin);
355355
const bool over_stopline = (dist_stopline < 0.0);
356356
const bool is_stopped_duration = planner_data_->isVehicleStopped(duration);
357-
if (over_stopline) {
358-
state_machine.setState(StateMachine::State::GO);
359-
} else if (is_stopped_duration && approached_dist_stopline) {
357+
if (over_stopline || (is_stopped_duration && approached_dist_stopline)) {
360358
state_machine.setState(StateMachine::State::GO);
361359
}
362360
return state_machine.getState() == StateMachine::State::GO;
@@ -367,12 +365,7 @@ DecisionResult IntersectionModule::modifyPathVelocityDetail(PathWithLaneId * pat
367365
(std::fabs(dist_stopline) < planner_param_.common.stopline_overshoot_margin);
368366
const bool over_stopline = (dist_stopline < -planner_param_.common.stopline_overshoot_margin);
369367
const bool is_stopped = planner_data_->isVehicleStopped(duration);
370-
if (over_stopline) {
371-
return true;
372-
} else if (is_stopped && approached_dist_stopline) {
373-
return true;
374-
}
375-
return false;
368+
return over_stopline || (is_stopped && approached_dist_stopline);
376369
};
377370

378371
const auto occlusion_wo_tl_pass_judge_line_idx =

0 commit comments

Comments
 (0)