1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:17:45 +00:00

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.
This commit is contained in:
Andreas Kling 2019-04-20 14:02:19 +02:00
parent 7faf8fabf2
commit 5eedb22834
17 changed files with 53 additions and 50 deletions

View file

@ -14,7 +14,7 @@ void DisjointRectSet::add(const Rect& new_rect)
void DisjointRectSet::shatter()
{
Vector<Rect> output;
Vector<Rect, 32> output;
output.ensure_capacity(m_rects.size());
bool pass_had_intersections = false;
do {

View file

@ -13,11 +13,11 @@ public:
void clear() { m_rects.clear(); }
void clear_with_capacity() { m_rects.clear_with_capacity(); }
const Vector<Rect>& rects() const { return m_rects; }
const Vector<Rect, 32>& rects() const { return m_rects; }
private:
void shatter();
Vector<Rect> m_rects;
Vector<Rect, 32> m_rects;
};

View file

@ -75,7 +75,7 @@ protected:
Rect m_clip_origin;
Retained<GraphicsBitmap> m_target;
Vector<State> m_state_stack;
Vector<State, 4> m_state_stack;
};
class PainterStateSaver {