Skip to content

Commit

Permalink
able to pass an already unregistered old nodes to improve performance…
Browse files Browse the repository at this point in the history
… slightly
  • Loading branch information
justinbmeyer committed Jun 14, 2018
1 parent ef647dd commit cbad1bf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions can-view-nodelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,12 @@ var nodeLists = {
*
* @return {Array<Node>} The nodes that were removed from `nodeList`.
*/
update: function (nodeList, newNodes) {
update: function (nodeList, newNodes, oldNodes) {
// Unregister all childNodeLists.
var oldNodes = nodeLists.unregisterChildren(nodeList);
if(!oldNodes) {
// if oldNodes has been passed, we assume everything has already been unregistered.
oldNodes = nodeLists.unregisterChildren(nodeList);
}

var arr = [];
for (var i = 0, ref = arr.length = newNodes.length; i < ref; i++) {
Expand Down

0 comments on commit cbad1bf

Please sign in to comment.