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
+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