From d8e79b656bdb2f006ec3d1556ce4a459a04a32ed Mon Sep 17 00:00:00 2001 From: Evan Almloff Date: Tue, 9 Jan 2024 14:27:25 -0600 Subject: [PATCH] remove an extra clone --- packages/core/src/diff/component.rs | 6 +++--- packages/core/src/virtual_dom.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/src/diff/component.rs b/packages/core/src/diff/component.rs index f5aa707c4..d744efe8e 100644 --- a/packages/core/src/diff/component.rs +++ b/packages/core/src/diff/component.rs @@ -37,7 +37,7 @@ impl VirtualDom { &mut self, to: &mut impl WriteMutations, scope: ScopeId, - new_node: &RenderReturn, + new_node: RenderReturn, parent: Option, ) -> 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) } } diff --git a/packages/core/src/virtual_dom.rs b/packages/core/src/virtual_dom.rs index 08e3d5d34..7302c58ef 100644 --- a/packages/core/src/virtual_dom.rs +++ b/packages/core/src/virtual_dom.rs @@ -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); }