1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:27:34 +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

@ -112,14 +112,14 @@ public:
DeprecatedString const& name() const { return m_name; }
void set_name(DeprecatedString name) { m_name = move(name); }
NonnullRefPtrVector<Object>& children() { return m_children; }
NonnullRefPtrVector<Object> const& children() const { return m_children; }
Vector<NonnullRefPtr<Object>>& children() { return m_children; }
Vector<NonnullRefPtr<Object>> const& children() const { return m_children; }
template<typename Callback>
void for_each_child(Callback callback)
{
for (auto& child : m_children) {
if (callback(child) == IterationDecision::Break)
if (callback(*child) == IterationDecision::Break)
return;
}
}
@ -219,7 +219,7 @@ private:
int m_timer_id { 0 };
unsigned m_inspector_count { 0 };
HashMap<DeprecatedString, NonnullOwnPtr<Property>> m_properties;
NonnullRefPtrVector<Object> m_children;
Vector<NonnullRefPtr<Object>> m_children;
Function<bool(Core::Event&)> m_event_filter;
};