Replace some common index based for loops with for-of loops

Replaces many loops of the form:

```js
for (let i = 0; i < elements.length; ++i) {
    const i = elements[i];
   ...
}
```

with:

```js
for (const element of elements) {
    ...
}
```

Mix of a horrible regex based find/replace and manual touch ups
This commit is contained in:
Matt Bierner
2019-01-03 19:11:18 -08:00
parent dc261e0436
commit b4964bcf35
74 changed files with 139 additions and 227 deletions

View File

@@ -29,9 +29,9 @@ function updateCSSNode(editor: TextEditor, property: Property): Thenable<boolean
let currentPrefix = '';
// Find vendor prefix of given property node
for (let i = 0; i < vendorPrefixes.length; i++) {
if (property.name.startsWith(vendorPrefixes[i])) {
currentPrefix = vendorPrefixes[i];
for (const prefix of vendorPrefixes) {
if (property.name.startsWith(prefix)) {
currentPrefix = prefix;
break;
}
}