Skip to content

Commit 0efa14a

Browse files
committed
fix: remove else statements after return
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
1 parent 91f0528 commit 0efa14a

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
@@ -246,7 +246,8 @@ StaticCenterlineGeneratorNode::StaticCenterlineGeneratorNode(
246246
if (centerline_source_param == "optimization_trajectory_base") {
247247
optimization_trajectory_based_centerline_ = OptimizationTrajectoryBasedCenterline(*this);
248248
return CenterlineSource::OptimizationTrajectoryBase;
249-
} else if (centerline_source_param == "bag_ego_trajectory_base") {
249+
}
250+
if (centerline_source_param == "bag_ego_trajectory_base") {
250251
return CenterlineSource::BagEgoTrajectoryBase;
251252
}
252253
throw std::logic_error(
@@ -305,7 +306,8 @@ CenterlineWithRoute StaticCenterlineGeneratorNode::generate_centerline_with_rout
305306
optimization_trajectory_based_centerline_.generate_centerline_with_optimization(
306307
*this, *route_handler_ptr_, route_lane_ids);
307308
return CenterlineWithRoute{optimized_centerline, route_lane_ids};
308-
} else if (centerline_source_ == CenterlineSource::BagEgoTrajectoryBase) {
309+
}
310+
if (centerline_source_ == CenterlineSource::BagEgoTrajectoryBase) {
309311
const auto bag_centerline = generate_centerline_with_bag(*this);
310312
const auto start_lanelets =
311313
route_handler_ptr_->getClosestLanelets(bag_centerline.front().pose);
@@ -443,14 +445,14 @@ std::vector<lanelet::Id> StaticCenterlineGeneratorNode::plan_route(
443445
mission_planner->initialize(&node, map_bin_ptr_);
444446

445447
// plan route
446-
const auto route = mission_planner->plan(check_points);
448+
auto route = mission_planner->plan(check_points);
447449

448450
return route;
449451
}();
450452
RCLCPP_INFO(get_logger(), "Planned route.");
451453

452454
// get lanelets
453-
const auto route_lane_ids = get_lane_ids_from_route(route);
455+
auto route_lane_ids = get_lane_ids_from_route(route);
454456
return route_lane_ids;
455457
}
456458

0 commit comments

Comments
 (0)