Skip to content

Commit

Permalink
fix(autoware_image_projection_based_fusion): fix bugprone-misplaced-w…
Browse files Browse the repository at this point in the history
…idening-cast (#9226)

* fix: bugprone-misplaced-widening-cast

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

* fix: clang-format

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>

---------

Signed-off-by: kobayu858 <yutaro.kobayashi@tier4.jp>
  • Loading branch information
kobayu858 authored Nov 3, 2024
1 parent 6ec8820 commit f13503a
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ void updateOutputFusedObjects(
cluster.data.resize(clusters_data_size.at(i));
auto & feature_obj = output_objs.at(i);
if (
cluster.data.size() < std::size_t(min_cluster_size * cluster.point_step) ||
cluster.data.size() >= std::size_t(max_cluster_size * cluster.point_step)) {
cluster.data.size() <
static_cast<std::size_t>(min_cluster_size) * static_cast<std::size_t>(cluster.point_step) ||
cluster.data.size() >=
static_cast<std::size_t>(max_cluster_size) * static_cast<std::size_t>(cluster.point_step)) {
continue;
}

Expand All @@ -169,7 +171,9 @@ void updateOutputFusedObjects(
sensor_msgs::msg::PointCloud2 refine_cluster;
closest_cluster(
cluster, cluster_2d_tolerance, min_cluster_size, camera_orig_point_frame, refine_cluster);
if (refine_cluster.data.size() < std::size_t(min_cluster_size * cluster.point_step)) {
if (
refine_cluster.data.size() <
static_cast<std::size_t>(min_cluster_size) * static_cast<std::size_t>(cluster.point_step)) {
continue;
}

Expand Down

0 comments on commit f13503a

Please sign in to comment.