Skip to content

Commit 7f96c0c

Browse files
committed
Return result directly instead of mutating var
1 parent 50e4d09 commit 7f96c0c

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,24 +192,16 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput {
192192
}
193193

194194
getTitle(verbosity: Verbosity): string {
195-
let title: string;
196195
switch (verbosity) {
197196
case Verbosity.SHORT:
198-
title = this.shortTitle;
199197
// already decorated by getName()
200-
break;
198+
return this.shortTitle;
201199
default:
202200
case Verbosity.MEDIUM:
203-
title = this.mediumTitle;
204-
title = this.decorateLabel(title);
205-
break;
201+
return this.decorateLabel(this.mediumTitle);
206202
case Verbosity.LONG:
207-
title = this.longTitle;
208-
title = this.decorateLabel(title);
209-
break;
203+
return this.decorateLabel(this.longTitle);
210204
}
211-
212-
return title;
213205
}
214206

215207
private decorateLabel(label: string): string {

0 commit comments

Comments
 (0)