1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:17:35 +00:00

Everywhere: Stop using NonnullRefPtrVector

This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.

This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
This commit is contained in:
Andreas Kling 2023-03-06 14:17:01 +01:00
parent 104be6c8ac
commit 8a48246ed1
168 changed files with 1280 additions and 1280 deletions

View file

@ -98,22 +98,22 @@ public:
{
if (index >= s_screens.size())
return nullptr;
return &s_screens[index];
return s_screens[index];
}
static Vector<Gfx::IntRect, 4> rects()
{
Vector<Gfx::IntRect, 4> rects;
for (auto& screen : s_screens)
rects.append(screen.rect());
rects.append(screen->rect());
return rects;
}
static Screen* find_by_location(Gfx::IntPoint point)
{
for (auto& screen : s_screens) {
if (screen.rect().contains(point))
return &screen;
if (screen->rect().contains(point))
return screen;
}
return nullptr;
}
@ -127,7 +127,7 @@ public:
static IterationDecision for_each(F f)
{
for (auto& screen : s_screens) {
IterationDecision decision = f(screen);
IterationDecision decision = f(*screen);
if (decision != IterationDecision::Continue)
return decision;
}
@ -187,7 +187,7 @@ private:
static void update_indices()
{
for (size_t i = 0; i < s_screens.size(); i++)
s_screens[i].m_index = i;
s_screens[i]->m_index = i;
}
static void update_bounding_rect();
static void update_scale_factors_in_use();
@ -199,7 +199,7 @@ private:
ScreenLayout::Screen& screen_layout_info() { return s_layout.screens[m_index]; }
ScreenLayout::Screen const& screen_layout_info() const { return s_layout.screens[m_index]; }
static NonnullRefPtrVector<Screen, default_screen_count> s_screens;
static Vector<NonnullRefPtr<Screen>, default_screen_count> s_screens;
static Screen* s_main_screen;
static Gfx::IntRect s_bounding_screens_rect;
static ScreenLayout s_layout;