Skip to content

Commit 443ecc7

Browse files
authored
chore: simplified array.from map (#9102)
1 parent 821aa20 commit 443ecc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/ui/client/composables/explorer/collector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function traverseReceivedFiles(collect: boolean) {
214214
continue
215215
}
216216
createOrUpdateFileNode(file, collect)
217-
createOrUpdateEntry(Array.from(entries).map(id => idMap.get(id)).filter(Boolean) as Task[])
217+
createOrUpdateEntry(Array.from(entries, id => idMap.get(id)).filter(Boolean) as Task[])
218218
}
219219
}
220220

@@ -303,7 +303,7 @@ function collectData(
303303
) {
304304
const idMap = client.state.idMap
305305
const filesMap = new Map(explorerTree.root.tasks.filter(f => idMap.has(f.id)).map(f => [f.id, f]))
306-
const useFiles = Array.from(filesMap.values()).map(file => [file.id, findById(file.id)] as const)
306+
const useFiles = Array.from(filesMap.values(), file => [file.id, findById(file.id)] as const)
307307
const data = {
308308
files: filesMap.size,
309309
time: time > 1000 ? `${(time / 1000).toFixed(2)}s` : `${Math.round(time)}ms`,

0 commit comments

Comments
 (0)