Improved comment for clarity.

This commit is contained in:
Eric Traut 2024-09-13 10:00:16 -07:00
parent edaeab2bc2
commit 9ea762f416

View File

@ -1489,8 +1489,8 @@ export class Program {
newImports.push(newImport);
}
});
// Only mutate if absolutely necessary otherwise we
// can end up rebinding a lot of files we don't need to.
// Mutate only when necessary to avoid extra binding operations.
if (
newImports.length !== sourceFileInfo.imports.length ||
!newImports.every((i) => sourceFileInfo.imports.includes(i))