Use for-of loops in place of some common index based loops

This commit is contained in:
Matt Bierner
2019-01-11 14:38:41 -08:00
parent beef295f9a
commit b6715540e7
18 changed files with 26 additions and 52 deletions
+1 -2
View File
@@ -987,8 +987,7 @@ export class TreeView extends HeightMap {
// 50 is an optimization number, at some point we're better off
// just replacing everything
if (!skipDiff && !doToInsertItemsAlreadyExist && diff.length < 50) {
for (let i = 0, len = diff.length; i < len; i++) {
const diffChange = diff[i];
for (const diffChange of diff) {
if (diffChange.originalLength > 0) {
this.onRemoveItems(new ArrayIterator(previousChildrenIds, diffChange.originalStart, diffChange.originalStart + diffChange.originalLength));