From 170161d67febfc0d916707edb28bd58772be8ff2 Mon Sep 17 00:00:00 2001 From: BattleBas Date: Tue, 17 Oct 2017 22:23:52 -0500 Subject: [PATCH] Simplified method to check active file Updated the "detectActiveFile" method to be more simple and straightforward. Thanks to @lodenrogue suggestion! --- extensions/git/src/repository.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index b99158bbc96..ac2d24fe1be 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -811,14 +811,8 @@ export class Repository implements Disposable { this._onDidChangeStatus.fire(); } - private detectActiveFile(fullFilePath: string): boolean { - if (window.activeTextEditor !== undefined) { - if (window.activeTextEditor.document.fileName === fullFilePath) { - return true; - } - } - - return false; + private detectActiveFile(fullFilePath: string): boolean | undefined { + return window.activeTextEditor && window.activeTextEditor.document.fileName === fullFilePath; } private onFSChange(uri: Uri): void {