Skip to content

Commit

Permalink
No need for casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferry Schoenmakers committed Feb 1, 2024
1 parent 8ed0325 commit 45ae82c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions diagnostic_aggregator/src/aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<DiagnosticStatus> msg_to_report;

std::vector<std::shared_ptr<DiagnosticStatus>> processed;
Expand All @@ -231,7 +231,7 @@ void Aggregator::publishData()
}
for (const auto & msg : processed) {
diag_array.status.push_back(*msg);
const uint depth = static_cast<uint>(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;
Expand Down Expand Up @@ -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<uint>(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;
Expand Down

0 comments on commit 45ae82c

Please sign in to comment.