From 4de0f68486d050ade701d2370310e0d56a32a62f Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Wed, 1 Sep 2021 02:06:20 -0700 Subject: [PATCH] Profiler: Minor static code analysis issues in FlameGraphView --- Userland/DevTools/Profiler/FlameGraphView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/DevTools/Profiler/FlameGraphView.cpp b/Userland/DevTools/Profiler/FlameGraphView.cpp index a7de5887f0f..6c57d7f0ff6 100644 --- a/Userland/DevTools/Profiler/FlameGraphView.cpp +++ b/Userland/DevTools/Profiler/FlameGraphView.cpp @@ -24,7 +24,7 @@ Vector s_colors; static Vector const& get_colors() { - if (s_colors.size() == 0) { + if (s_colors.is_empty()) { // Start with a nice orange, then make shades of it Gfx::Color midpoint(255, 94, 19); s_colors.extend(midpoint.shades(3, 0.5f)); @@ -115,7 +115,7 @@ void FlameGraphView::paint_event(GUI::PaintEvent& event) GUI::Painter painter(*this); painter.add_clip_rect(event.rect()); - for (auto& bar : m_bars) { + for (const auto& bar : m_bars) { auto label_index = bar.index.sibling_at_column(m_text_column); String label = "All"; if (label_index.is_valid()) { @@ -152,7 +152,7 @@ void FlameGraphView::layout_bars() { m_bars.clear(); - // Explicit copy here so the layout can multate + // Explicit copy here so the layout can mutate Vector selected = m_selected_indexes; GUI::ModelIndex null_index; layout_children(null_index, 0, 0, this->width(), selected);