Skip to content

Commit

Permalink
style(aggregator): use enums instead of plain ints
Browse files Browse the repository at this point in the history
  • Loading branch information
rokusottervanger committed Apr 8, 2022
1 parent 32f31dc commit e4a42ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions diagnostic_aggregator/src/aggregator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,10 @@ void Aggregator::publishData()
agg_pub_.publish(diag_array);

// Top level is error if we have stale items, unless all stale
if (diag_toplevel_state.level > 2 && min_level <= 2)
diag_toplevel_state.level = 2;
if (diag_toplevel_state.level > int(DiagnosticLevel::Level_Error)
&& min_level <= int(DiagnosticLevel::Level_Error)) {
diag_toplevel_state.level = DiagnosticLevel::Level_Error;
}

// Store latest toplevel state for immediate publish checking
diag_toplevel_ = diag_toplevel_state.level;
Expand Down

0 comments on commit e4a42ff

Please sign in to comment.