Skip to content

Commit a91bfeb

Browse files
fix(pointcloud_preprocessor): fix arrayIndexThenCheck warning (#7547)
* fix(pointcloud_preprocessor): fix arrayIndexThenCheck waarning Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp> * fix deleted_azimuths's index Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp> * style(pre-commit): autofix * fix typo Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp> --------- Signed-off-by: Ryuta Kambe <ryuta.kambe@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8499417 commit a91bfeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sensing/pointcloud_preprocessor/src/outlier_filter/dual_return_outlier_filter_nodelet.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ void DualReturnOutlierFilterComponent::filter(
231231
if (deleted_azimuths.size() == 0) {
232232
continue;
233233
}
234-
while ((uint)deleted_azimuths[current_deleted_index] <
234+
while (current_deleted_index < deleted_azimuths.size() &&
235+
(uint)deleted_azimuths[current_deleted_index] <
235236
((i + static_cast<uint>(min_azimuth / horizontal_resolution) + 1) *
236-
horizontal_resolution) &&
237-
current_deleted_index < (deleted_azimuths.size() - 1)) {
237+
horizontal_resolution)) {
238238
noise_frequency[i] = noise_frequency[i] + 1;
239239
current_deleted_index++;
240240
}

0 commit comments

Comments
 (0)