Use standard for/of loop

This commit is contained in:
Matt Bierner
2020-03-02 12:59:04 -08:00
parent 0fa3af8b60
commit d34c2e0ee3
2 changed files with 6 additions and 6 deletions
@@ -38,13 +38,13 @@ export class CustomEditorModelManager implements ICustomEditorModelManager {
public disposeModel(model: ICustomEditorModel): void {
let foundKey: string | undefined;
this._models.forEach((value, key) => {
for (const [key, value] of this._models) {
if (model === value.model) {
value.disposables.dispose();
value.model.dispose();
foundKey = key;
}
});
}
if (typeof foundKey === 'string') {
this._models.delete(foundKey);
}
@@ -52,11 +52,11 @@ export class CustomEditorModelManager implements ICustomEditorModelManager {
}
public disposeAllModelsForView(viewType: string): void {
this._models.forEach((value) => {
for (const [, value] of this._models) {
if (value.model.viewType === viewType) {
this.disposeModel(value.model);
}
});
}
}
private key(resource: URI, viewType: string): string {
@@ -51,7 +51,7 @@ export class WebviewIconManager {
try {
const cssRules: string[] = [];
if (this._configService.getValue('workbench.iconTheme') !== null) {
this._icons.forEach((value, key) => {
for (const [key, value] of this._icons) {
const webviewSelector = `.show-file-icons .webview-${key}-name-file-icon::before`;
if (URI.isUri(value)) {
cssRules.push(`${webviewSelector} { content: ""; background-image: ${dom.asCSSUrl(value)}; }`);
@@ -59,7 +59,7 @@ export class WebviewIconManager {
cssRules.push(`.vs ${webviewSelector} { content: ""; background-image: ${dom.asCSSUrl(value.light)}; }`);
cssRules.push(`.vs-dark ${webviewSelector} { content: ""; background-image: ${dom.asCSSUrl(value.dark)}; }`);
}
});
}
}
this._styleElement.innerHTML = cssRules.join('\n');
} catch {