From 5eedb2283488fafef98c20729bc6917c6de957e5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 20 Apr 2019 14:02:19 +0200 Subject: Sprinkle use of AK::Vector in various places. Some of these are less helpful than others. Avoiding a bunch of mallocs in the event loop wakeup code is definitely nice. --- SharedGraphics/DisjointRectSet.cpp | 2 +- SharedGraphics/DisjointRectSet.h | 4 ++-- SharedGraphics/Painter.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'SharedGraphics') diff --git a/SharedGraphics/DisjointRectSet.cpp b/SharedGraphics/DisjointRectSet.cpp index a811899d76..38221fea66 100644 --- a/SharedGraphics/DisjointRectSet.cpp +++ b/SharedGraphics/DisjointRectSet.cpp @@ -14,7 +14,7 @@ void DisjointRectSet::add(const Rect& new_rect) void DisjointRectSet::shatter() { - Vector output; + Vector output; output.ensure_capacity(m_rects.size()); bool pass_had_intersections = false; do { diff --git a/SharedGraphics/DisjointRectSet.h b/SharedGraphics/DisjointRectSet.h index 5b3f26d20b..4256b933db 100644 --- a/SharedGraphics/DisjointRectSet.h +++ b/SharedGraphics/DisjointRectSet.h @@ -13,11 +13,11 @@ public: void clear() { m_rects.clear(); } void clear_with_capacity() { m_rects.clear_with_capacity(); } - const Vector& rects() const { return m_rects; } + const Vector& rects() const { return m_rects; } private: void shatter(); - Vector m_rects; + Vector m_rects; }; diff --git a/SharedGraphics/Painter.h b/SharedGraphics/Painter.h index 275d84463f..fe9cb65307 100644 --- a/SharedGraphics/Painter.h +++ b/SharedGraphics/Painter.h @@ -75,7 +75,7 @@ protected: Rect m_clip_origin; Retained m_target; - Vector m_state_stack; + Vector m_state_stack; }; class PainterStateSaver { -- cgit v1.2.3