From 7841c039fcbfa5e2be89c564f1b5138488235956 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 21 Feb 2018 00:07:19 -0800 Subject: [PATCH] :bug: use map instead of filter to return a promise --- src/client/interpreter/configuration/interpreterSelector.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/client/interpreter/configuration/interpreterSelector.ts b/src/client/interpreter/configuration/interpreterSelector.ts index 607be98c174c..1d116c7e2ab6 100644 --- a/src/client/interpreter/configuration/interpreterSelector.ts +++ b/src/client/interpreter/configuration/interpreterSelector.ts @@ -76,10 +76,7 @@ export class InterpreterSelector implements IInterpreterSelector { private async removeDuplicates(interpreters: PythonInterpreter[]): Promise { const result: PythonInterpreter[] = []; - await Promise.all(interpreters.filter(async x => { - x.realPath = await this.fileSystem.getRealPathAsync(x.path); - return true; - })); + await Promise.all(interpreters.map(async item => item.realPath = await this.fileSystem.getRealPathAsync(item.path))); interpreters.forEach(x => { if (result.findIndex(a => a.displayName === x.displayName && a.type === x.type && this.fileSystem.arePathsSame(a.realPath!, x.realPath!)) < 0) {