mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Use Array.from's map directly instead of a second call to map
This commit is contained in:
@@ -41,7 +41,7 @@ window.onload = () => {
|
|||||||
function doAfterImagesLoaded(cb: () => void) {
|
function doAfterImagesLoaded(cb: () => void) {
|
||||||
const imgElements = document.getElementsByTagName('img');
|
const imgElements = document.getElementsByTagName('img');
|
||||||
if (imgElements.length > 0) {
|
if (imgElements.length > 0) {
|
||||||
const ps = Array.from(imgElements).map(e => {
|
const ps = Array.from(imgElements, e => {
|
||||||
if (e.complete) {
|
if (e.complete) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ export default class MarkdownWorkspaceSymbolProvider extends Disposable implemen
|
|||||||
this._workspaceMarkdownDocumentProvider.onDidDeleteMarkdownDocument(this.onDidDeleteDocument, this, this._disposables);
|
this._workspaceMarkdownDocumentProvider.onDidDeleteMarkdownDocument(this.onDidDeleteDocument, this, this._disposables);
|
||||||
}
|
}
|
||||||
|
|
||||||
const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values()).map(x => x.value));
|
const allSymbolsSets = await Promise.all(Array.from(this._symbolCache.values(), x => x.value));
|
||||||
const allSymbols = allSymbolsSets.flat();
|
const allSymbols = allSymbolsSets.flat();
|
||||||
return allSymbols.filter(symbolInformation => symbolInformation.name.toLowerCase().indexOf(query.toLowerCase()) !== -1);
|
return allSymbols.filter(symbolInformation => symbolInformation.name.toLowerCase().indexOf(query.toLowerCase()) !== -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export class ResourceMap<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get values(): Iterable<T> {
|
public get values(): Iterable<T> {
|
||||||
return Array.from(this._map.values()).map(x => x.value);
|
return Array.from(this._map.values(), x => x.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get entries(): Iterable<{ resource: vscode.Uri, value: T }> {
|
public get entries(): Iterable<{ resource: vscode.Uri, value: T }> {
|
||||||
|
|||||||
Reference in New Issue
Block a user