mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibWeb: Use NonnullGCPtr for HTMLCollection::collect_matching_elements
The pointers here can never be null, so lets engrain that into the type for clarity.
This commit is contained in:
parent
e590e92399
commit
897f55ca8a
Notes:
sideshowbarker
2024-07-17 02:59:43 +09:00
Author: https://github.com/shannonbooth
Commit: 897f55ca8a
Pull-request: https://github.com/SerenityOS/serenity/pull/23788
2 changed files with 3 additions and 3 deletions
|
@ -50,7 +50,7 @@ void HTMLCollection::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(element);
|
||||
}
|
||||
|
||||
JS::MarkedVector<Element*> HTMLCollection::collect_matching_elements() const
|
||||
JS::MarkedVector<JS::NonnullGCPtr<Element>> HTMLCollection::collect_matching_elements() const
|
||||
{
|
||||
if (m_cached_dom_tree_version != root()->document().dom_tree_version()) {
|
||||
m_cached_elements.clear();
|
||||
|
@ -70,7 +70,7 @@ JS::MarkedVector<Element*> HTMLCollection::collect_matching_elements() const
|
|||
m_cached_dom_tree_version = root()->document().dom_tree_version();
|
||||
}
|
||||
|
||||
JS::MarkedVector<Element*> elements(heap());
|
||||
JS::MarkedVector<JS::NonnullGCPtr<Element>> elements(heap());
|
||||
for (auto& element : m_cached_elements)
|
||||
elements.append(element);
|
||||
return elements;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue