1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:57:44 +00:00

Everywhere: Stop using NonnullOwnPtrVector

Same as NonnullRefPtrVector: weird semantics, questionable benefits.
This commit is contained in:
Andreas Kling 2023-03-06 17:16:25 +01:00
parent 689ca370d4
commit 359d6e7b0b
111 changed files with 517 additions and 503 deletions

View file

@ -44,7 +44,7 @@ bool Node::operator==(Node const& other) const
if (element.children.size() != other_element->children.size())
return false;
for (size_t i = 0; i < element.children.size(); ++i) {
if (element.children[i] != other_element->children[i])
if (element.children[i].ptr() != other_element->children[i].ptr())
return false;
}
return true;

View file

@ -30,7 +30,7 @@ struct Node {
struct Element {
Name name;
HashMap<Name, DeprecatedString> attributes;
NonnullOwnPtrVector<Node> children;
Vector<NonnullOwnPtr<Node>> children;
};
bool operator==(Node const&) const;

View file

@ -95,7 +95,7 @@ void Parser::append_text(StringView text)
m_entered_node->content.visit(
[&](Node::Element& node) {
if (!node.children.is_empty()) {
auto* text_node = node.children.last().content.get_pointer<Node::Text>();
auto* text_node = node.children.last()->content.get_pointer<Node::Text>();
if (text_node) {
text_node->builder.append(text);
return;