mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
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:
@@ -237,9 +237,9 @@ export default class CommandHandler implements vscode.Disposable {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (let i = 0; i < conflicts.length; i++) {
|
||||
if (conflicts[i].range.contains(editor.selection.active)) {
|
||||
return conflicts[i];
|
||||
for (const conflict of conflicts) {
|
||||
if (conflict.range.contains(editor.selection.active)) {
|
||||
return conflict;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user