perf(transformer): avoid unneccessary vec allocation#17270
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
This PR optimizes performance by eliminating an unnecessary intermediate Vec allocation. Instead of collecting an iterator into a Vec and then extending another collection with it, the code now directly extends with the iterator, as the extend method accepts any type implementing IntoIterator.
Key Changes:
- Removed intermediate
.collect::<Vec<_>>()call when extendingtemp_decls - Simplified code by directly passing the iterator to
extend()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17270 will not alter performanceComparing Summary
Footnotes
|
Merge activity
|
avoid collecting into a vec when extends can accept an iterator instead
5634053 to
e35049b
Compare

avoid collecting into a vec when extends can accept an iterator instead