From 26cd646618f9437e1732257093c4d4ce96b3a1f7 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 19 Nov 2018 16:28:02 -0800 Subject: [PATCH] Remove unnessisary conditional The body of these specific events are always non-null --- .../src/typescriptServiceClient.ts | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index c16d277cb02..4e275b7dbc5 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -619,41 +619,29 @@ export default class TypeScriptServiceClient extends Disposable implements IType break; case 'projectLanguageServiceState': - if (event.body) { - this._onProjectLanguageServiceStateChanged.fire((event as Proto.ProjectLanguageServiceStateEvent).body); - } + this._onProjectLanguageServiceStateChanged.fire((event as Proto.ProjectLanguageServiceStateEvent).body); break; case 'projectsUpdatedInBackground': - if (event.body) { - const body = (event as Proto.ProjectsUpdatedInBackgroundEvent).body; - const resources = body.openFiles.map(vscode.Uri.file); - this.bufferSyncSupport.getErr(resources); - } + const body = (event as Proto.ProjectsUpdatedInBackgroundEvent).body; + const resources = body.openFiles.map(vscode.Uri.file); + this.bufferSyncSupport.getErr(resources); break; case 'beginInstallTypes': - if (event.body) { - this._onDidBeginInstallTypings.fire((event as Proto.BeginInstallTypesEvent).body); - } + this._onDidBeginInstallTypings.fire((event as Proto.BeginInstallTypesEvent).body); break; case 'endInstallTypes': - if (event.body) { - this._onDidEndInstallTypings.fire((event as Proto.EndInstallTypesEvent).body); - } + this._onDidEndInstallTypings.fire((event as Proto.EndInstallTypesEvent).body); break; case 'typesInstallerInitializationFailed': - if (event.body) { - this._onTypesInstallerInitializationFailed.fire((event as Proto.TypesInstallerInitializationFailedEvent).body); - } + this._onTypesInstallerInitializationFailed.fire((event as Proto.TypesInstallerInitializationFailedEvent).body); break; case 'surveyReady': - if (event.body) { - this._onSurveyReady.fire((event as Proto.SurveyReadyEvent).body); - } + this._onSurveyReady.fire((event as Proto.SurveyReadyEvent).body); break; case 'projectLoadingStart': -- GitLab