Skip to content

Commit 603c8a2

Browse files
committed
feat: dont generate new object
1 parent 06bdfec commit 603c8a2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/util/edit.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ export const edit = async ({
635635
break;
636636
}
637637

638+
const current = {
639+
vertexes: dependencyGraph.vertexes,
640+
files: fileService.eject(),
641+
fileNames: fileService.getFileNames(),
642+
};
643+
638644
const next = first
639645
.map((v) => {
640646
// if the file is not in the file service, it means it has been deleted in a previous iteration
@@ -644,9 +650,9 @@ export const edit = async ({
644650

645651
const result = processFile({
646652
targetFile: v.file,
647-
vertexes: dependencyGraph.eject(),
648-
files: fileService.eject(),
649-
fileNames: fileService.getFileNames(),
653+
vertexes: current.vertexes,
654+
files: current.files,
655+
fileNames: current.fileNames,
650656
deleteUnusedFile,
651657
enableCodeFix,
652658
options,

0 commit comments

Comments
 (0)