remove an extra clone
This commit is contained in:
1 parent
f1b2f964c0
commit
d8e79b656b
2 files changed
+4
-4
No files matched your search
@@ -37,7 +37,7 @@ impl VirtualDom {
|
|||||||
&mut self,
|
&mut self,
|
||||||
to: &mut impl WriteMutations,
|
to: &mut impl WriteMutations,
|
||||||
scope: ScopeId,
|
scope: ScopeId,
|
||||||
new_node: &RenderReturn,
|
new_node: RenderReturn,
|
||||||
parent: Option<ElementRef>,
|
parent: Option<ElementRef>,
|
||||||
) -> usize {
|
) -> usize {
|
||||||
self.runtime.scope_stack.borrow_mut().push(scope);
|
self.runtime.scope_stack.borrow_mut().push(scope);
|
||||||
@@ -46,7 +46,7 @@ impl VirtualDom {
|
|||||||
let nodes = new_node.create(self, to, parent);
|
let nodes = new_node.create(self, to, parent);
|
||||||
|
|
||||||
// Then set the new node as the last rendered node
|
// 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();
|
self.runtime.scope_stack.borrow_mut().pop();
|
||||||
nodes
|
nodes
|
||||||
@@ -140,6 +140,6 @@ impl VNode {
|
|||||||
|
|
||||||
let new = dom.run_scope(scope);
|
let new = dom.run_scope(scope);
|
||||||
|
|
||||||
dom.create_scope(to, scope, &new, parent)
|
dom.create_scope(to, scope, new, parent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -558,7 +558,7 @@ impl VirtualDom {
|
|||||||
let new_nodes = self.run_scope(ScopeId::ROOT);
|
let new_nodes = self.run_scope(ScopeId::ROOT);
|
||||||
|
|
||||||
// Rebuilding implies we append the created elements to the 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);
|
to.append_children(ElementId(0), m);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user