mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Prefer coalesce over filter
Coalesce has the correct return type of `T[]`. Filter may return `(T | undefined)[]`
This commit is contained in:
@@ -109,7 +109,7 @@ export class FileIndexSearchEngine {
|
||||
errs = [errs];
|
||||
}
|
||||
|
||||
errs = errs.filter(e => !!e);
|
||||
errs = arrays.coalesce(errs);
|
||||
return Promise.reject(errs[0]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user