Merge pull request #915 from Demonthos/fix-empty-mutations
Don't add no op mutations when diffing lists
This commit is contained in:
1 file changed
+7
-1
@@ -628,10 +628,12 @@ impl<'b> VirtualDom {
|
||||
}
|
||||
|
||||
let id = self.find_last_element(&new[last]);
|
||||
if nodes_created > 0 {
|
||||
self.mutations.push(Mutation::InsertAfter {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
})
|
||||
}
|
||||
nodes_created = 0;
|
||||
}
|
||||
|
||||
@@ -652,10 +654,12 @@ impl<'b> VirtualDom {
|
||||
}
|
||||
|
||||
let id = self.find_first_element(&new[last]);
|
||||
if nodes_created > 0 {
|
||||
self.mutations.push(Mutation::InsertBefore {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
}
|
||||
|
||||
nodes_created = 0;
|
||||
}
|
||||
@@ -676,12 +680,14 @@ impl<'b> VirtualDom {
|
||||
}
|
||||
|
||||
let id = self.find_first_element(&new[first_lis]);
|
||||
if nodes_created > 0 {
|
||||
self.mutations.push(Mutation::InsertBefore {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Push all the real nodes on the stack
|
||||
fn push_all_real_nodes(&mut self, node: &'b VNode<'b>) -> usize {
|
||||
|
||||
Reference in new issue
Block a user