From d43019d9bddfc7f6170db6015326e4b30133fdad Mon Sep 17 00:00:00 2001 From: Tim Clephas Date: Sat, 4 Feb 2023 19:51:16 +0100 Subject: [PATCH] Fix code-analyser bug --- diagnostic_aggregator/src/aggregator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diagnostic_aggregator/src/aggregator.cpp b/diagnostic_aggregator/src/aggregator.cpp index 002f944db..99d75df72 100644 --- a/diagnostic_aggregator/src/aggregator.cpp +++ b/diagnostic_aggregator/src/aggregator.cpp @@ -129,9 +129,9 @@ void Aggregator::checkTimestamp(const DiagnosticArray::SharedPtr diag_msg) stamp_warn += it->name; } - if (!ros_warnings_.count(stamp_warn)) { + auto result = ros_warnings_.insert(stamp_warn); + if (result.second) { RCLCPP_WARN(logger_, "%s", stamp_warn.c_str()); - ros_warnings_.insert(stamp_warn); } }