From 45ae82ceaa3b36e0f3d31d9e521cc2cdc949ccf5 Mon Sep 17 00:00:00 2001 From: Ferry Schoenmakers Date: Thu, 1 Feb 2024 15:32:06 +0100 Subject: [PATCH] No need for casting --- diagnostic_aggregator/src/aggregator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diagnostic_aggregator/src/aggregator.cpp b/diagnostic_aggregator/src/aggregator.cpp index 11ff7e47..c8cf9eb9 100644 --- a/diagnostic_aggregator/src/aggregator.cpp +++ b/diagnostic_aggregator/src/aggregator.cpp @@ -221,7 +221,7 @@ void Aggregator::publishData() diag_toplevel_state.level = DiagnosticStatus::STALE; int max_level = -1; int min_level = 255; - uint non_ok_status_depth = 0; + int non_ok_status_depth = 0; std::shared_ptr msg_to_report; std::vector> processed; @@ -231,7 +231,7 @@ void Aggregator::publishData() } for (const auto & msg : processed) { diag_array.status.push_back(*msg); - const uint depth = static_cast(std::count(msg->name.begin(), msg->name.end(), '/')); + const auto depth = std::count(msg->name.begin(), msg->name.end(), '/'); if (msg->level > max_level) { max_level = msg->level; @@ -259,7 +259,7 @@ void Aggregator::publishData() other_analyzer_->report(); for (const auto & msg : processed_other) { diag_array.status.push_back(*msg); - const uint depth = static_cast(std::count(msg->name.begin(), msg->name.end(), '/')); + const auto depth = std::count(msg->name.begin(), msg->name.end(), '/'); if (msg->level > max_level) { max_level = msg->level;