Skip to content

Commit f5a9d80

Browse files
committed
fix: remove else statements after return
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
1 parent 99cc03a commit f5a9d80

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

planning/static_centerline_generator/src/static_centerline_generator_node.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ StaticCenterlineGeneratorNode::StaticCenterlineGeneratorNode(
245245
if (centerline_source_param == "optimization_trajectory_base") {
246246
optimization_trajectory_based_centerline_ = OptimizationTrajectoryBasedCenterline(*this);
247247
return CenterlineSource::OptimizationTrajectoryBase;
248-
} else if (centerline_source_param == "bag_ego_trajectory_base") {
248+
}
249+
if (centerline_source_param == "bag_ego_trajectory_base") {
249250
return CenterlineSource::BagEgoTrajectoryBase;
250251
}
251252
throw std::logic_error(
@@ -304,7 +305,8 @@ CenterlineWithRoute StaticCenterlineGeneratorNode::generate_centerline_with_rout
304305
optimization_trajectory_based_centerline_.generate_centerline_with_optimization(
305306
*this, *route_handler_ptr_, route_lane_ids);
306307
return CenterlineWithRoute{optimized_centerline, route_lane_ids};
307-
} else if (centerline_source_ == CenterlineSource::BagEgoTrajectoryBase) {
308+
}
309+
if (centerline_source_ == CenterlineSource::BagEgoTrajectoryBase) {
308310
const auto bag_centerline = generate_centerline_with_bag(*this);
309311
const auto start_lanelets =
310312
route_handler_ptr_->getClosestLanelets(bag_centerline.front().pose);
@@ -435,14 +437,14 @@ std::vector<lanelet::Id> StaticCenterlineGeneratorNode::plan_route(
435437
mission_planner->initialize(&node, map_bin_ptr_);
436438

437439
// plan route
438-
const auto route = mission_planner->plan(check_points);
440+
auto route = mission_planner->plan(check_points);
439441

440442
return route;
441443
}();
442444
RCLCPP_INFO(get_logger(), "Planned route.");
443445

444446
// get lanelets
445-
const auto route_lane_ids = get_lane_ids_from_route(route);
447+
auto route_lane_ids = get_lane_ids_from_route(route);
446448
return route_lane_ids;
447449
}
448450

0 commit comments

Comments
 (0)