remove an extra clone

This commit is contained in:
Evan Almloff 2024-01-09 14:27:25 -06:00
parent f1b2f964c0
commit d8e79b656b
2 changed files with 4 additions and 4 deletions

View file

@ -37,7 +37,7 @@ impl VirtualDom {
&mut self,
to: &mut impl WriteMutations,
scope: ScopeId,
new_node: &RenderReturn,
new_node: RenderReturn,
parent: Option<ElementRef>,
) -> usize {
self.runtime.scope_stack.borrow_mut().push(scope);
@ -46,7 +46,7 @@ impl VirtualDom {
let nodes = new_node.create(self, to, parent);
// Then set the new node as the last rendered node
self.scopes[scope.0].last_rendered_node = Some(new_node.clone());
self.scopes[scope.0].last_rendered_node = Some(new_node);
self.runtime.scope_stack.borrow_mut().pop();
nodes
@ -140,6 +140,6 @@ impl VNode {
let new = dom.run_scope(scope);
dom.create_scope(to, scope, &new, parent)
dom.create_scope(to, scope, new, parent)
}
}

View file

@ -558,7 +558,7 @@ impl VirtualDom {
let new_nodes = self.run_scope(ScopeId::ROOT);
// Rebuilding implies we append the created elements to the root
let m = self.create_scope(to, ScopeId::ROOT, &new_nodes, None);
let m = self.create_scope(to, ScopeId::ROOT, new_nodes, None);
to.append_children(ElementId(0), m);
}