Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: optimize clean command by precomputing paths to clean (#855)
## **Description** This PR optimizes the `_cleanPackage` method by precomputing the paths to clean (`pathsToClean`) before iterating through them. Specifically, relative paths are joined with the package root using `p.join` ahead of time, avoiding repeated path computations during the loop. ### **Key Changes**: **Precomputing Paths**: - `pathsToClean` now contains fully resolved paths created by combining relative paths (`cleanablePubFilePaths` and `.dart_tool`) with the package root. - This eliminates the need for `p.join` operations inside the loop, improving both performance and code readability. --- ## **Type of Change** - [ ] ✨ `feat` -- New feature (non-breaking change which adds functionality) - [ ] 🛠️ `fix` -- Bug fix (non-breaking change which fixes an issue) - [ ] ❌ `!` -- Breaking change (fix or feature that would cause existing functionality to change) - [x] 🧹 `refactor` -- Code refactor - [ ] ✅ `ci` -- Build configuration change - [ ] 📝 `docs` -- Documentation - [ ] 🗑️ `chore` -- Chore --- ## **Checklist** <!--- Put an `x` in all the boxes that apply: --> - [x] I have read the [[CONTRIBUTING](https://github.com/invertase/melos/blob/main/CONTRIBUTING.md)](https://github.com/invertase/melos/blob/main/CONTRIBUTING.md) guidelines. - [x] I have read the [[Invertase's Code of Conduct](https://github.com/invertase/meta/blob/main/CODE_OF_CONDUCT.md)](https://github.com/invertase/meta/blob/main/CODE_OF_CONDUCT.md). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added necessary documentation (if applicable). - [x] I have run `melos bootstrap` and confirmed it is working as expected locally.
- Loading branch information