don't add no op mutations
This commit is contained in:
1 parent
9a053a0b51
commit
3bb6c4bc30
1 file changed
+18
-12
+18
-12
@@ -628,10 +628,12 @@ impl<'b> VirtualDom {
|
||||
}
|
||||
|
||||
let id = self.find_last_element(&new[last]);
|
||||
self.mutations.push(Mutation::InsertAfter {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
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]);
|
||||
self.mutations.push(Mutation::InsertBefore {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
if nodes_created > 0 {
|
||||
self.mutations.push(Mutation::InsertBefore {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
}
|
||||
|
||||
nodes_created = 0;
|
||||
}
|
||||
@@ -676,10 +680,12 @@ impl<'b> VirtualDom {
|
||||
}
|
||||
|
||||
let id = self.find_first_element(&new[first_lis]);
|
||||
self.mutations.push(Mutation::InsertBefore {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
if nodes_created > 0 {
|
||||
self.mutations.push(Mutation::InsertBefore {
|
||||
id,
|
||||
m: nodes_created,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user