Profiler: Minor static code analysis issues in FlameGraphView

This commit is contained in:
Brian Gianforcaro 2021-09-01 02:06:20 -07:00 committed by Andreas Kling
parent 16f0248ca2
commit 4de0f68486
Notes: sideshowbarker 2024-07-18 04:55:58 +09:00

View file

@ -24,7 +24,7 @@ Vector<Gfx::Color> s_colors;
static Vector<Gfx::Color> 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<GUI::ModelIndex> selected = m_selected_indexes;
GUI::ModelIndex null_index;
layout_children(null_index, 0, 0, this->width(), selected);