From e8ea100332028f463de7ab215da5d433ff20952f Mon Sep 17 00:00:00 2001 From: kobayu858 <129580202+kobayu858@users.noreply.github.com> Date: Thu, 12 Dec 2024 19:02:40 +0900 Subject: [PATCH] fix(perception_online_evaluator): fix bugprone-branch-clone (#9631) fix: bugprone-branch-clone Signed-off-by: kobayu858 --- .../src/metrics/detection_count.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/evaluator/perception_online_evaluator/src/metrics/detection_count.cpp b/evaluator/perception_online_evaluator/src/metrics/detection_count.cpp index 4a1d97aeeb90b..1bbfb9e3ee963 100644 --- a/evaluator/perception_online_evaluator/src/metrics/detection_count.cpp +++ b/evaluator/perception_online_evaluator/src/metrics/detection_count.cpp @@ -110,10 +110,9 @@ void DetectionCounter::initializeDetectionMap() ++i) { for (const auto & range : getRanges()) { std::string range_str = range.toString(); - if (time_series_counts_.find(i) == time_series_counts_.end()) { - time_series_counts_[i][range_str] = std::vector(); - seen_uuids_[i][range_str] = std::set(); - } else if (time_series_counts_[i].find(range_str) == time_series_counts_[i].end()) { + if ( + time_series_counts_[i].find(range_str) == time_series_counts_[i].end() || + time_series_counts_.find(i) == time_series_counts_.end()) { time_series_counts_[i][range_str] = std::vector(); seen_uuids_[i][range_str] = std::set(); }