cache node.children[i] for 10% speedup.

This commit is contained in:
Paul Irish
2018-03-19 10:32:23 -07:00
committed by Ilya Grigorik
parent b31d53a4d0
commit 343a9573ff

View File

@@ -279,9 +279,8 @@ chrome.runtime.sendMessage({}, function(response) {
} }
} else if (node.children != undefined) { } else if (node.children != undefined) {
for (var i = 0; i < node.children.length; i++) { for (var i = 0; i < node.children.length; i++) {
checkForVideo(node.children[i], const child = node.children[i];
node.children[i].parentNode || parent, checkForVideo(child, child.parentNode || parent, added);
added);
} }
} }
} }