Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(transformer/jsx): take ownership of Vec values by into_iter rather than drain #9216

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Feb 19, 2025

This change I forgot to do this in #9209, In the case of owning Vec, we do not need to obtain the value owner through drain but into_iter.

The diff in this PR is hard to diff. My purpose is to change drain to into_iter, other changes are for solving the borrow check and keeping the same output.

@Dunqing Dunqing changed the title refactor(transformer): take ownership of vec values by into_iter rather than drain refactor(transformer): take ownership of Vec values by into_iter rather than drain Feb 19, 2025
@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Feb 19, 2025
Copy link
Member Author

Dunqing commented Feb 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@Dunqing Dunqing changed the title refactor(transformer): take ownership of Vec values by into_iter rather than drain refactor(transformer/jsx): take ownership of Vec values by into_iter rather than drain Feb 19, 2025
Copy link

codspeed-hq bot commented Feb 19, 2025

CodSpeed Performance Report

Merging #9216 will not alter performance

Comparing 02-19-refactor_transformer_take_ownership_of_vec_values_by_into_iter_rather_than_drain (25c4d69) with main (cc6c497)

Summary

✅ 33 untouched benchmarks

@Dunqing
Copy link
Member Author

Dunqing commented Feb 19, 2025

I expect this to have some visible performance improvements but it is not, anyway I think this is a good refactor!

Copy link
Contributor

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement. We're now only branching once on is_automatic, rather than multiple times. This makes the code easier to understand, even though it doesn't seem to affect performance.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Feb 19, 2025
Copy link
Contributor

overlookmotel commented Feb 19, 2025

Merge activity

  • Feb 19, 6:13 AM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Feb 19, 6:13 AM EST: A user added this pull request to the Graphite merge queue.
  • Feb 19, 6:18 AM EST: A user merged this pull request with the Graphite merge queue.

…er` rather than `drain` (#9216)

This change I forgot to do this in #9209, In the case of owning `Vec`, we do not need to obtain the value owner through `drain` but `into_iter`.

The diff in this PR is hard to diff. My purpose is to change `drain` to `into_iter`, other changes are for solving the borrow check and keeping the same output.
@graphite-app graphite-app bot force-pushed the 02-19-refactor_transformer_take_ownership_of_vec_values_by_into_iter_rather_than_drain branch from 55a11bf to 25c4d69 Compare February 19, 2025 11:14
@graphite-app graphite-app bot merged commit 25c4d69 into main Feb 19, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 02-19-refactor_transformer_take_ownership_of_vec_values_by_into_iter_rather_than_drain branch February 19, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants