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/class-properties): duplicate_object_twice method #7685

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Dec 5, 2024

Follow-up after #7664.

Generalize duplicate_object to produce however many duplicates are required. Use it in transform_expression_to_wrap_nullish_check.

This should be slightly more efficient, and will make it fool-proof if we expand duplicate_object later to handle other Expression types.

Copy link

graphite-app bot commented Dec 5, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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 Dec 5, 2024
@overlookmotel overlookmotel marked this pull request as ready for review December 5, 2024 18:13
Copy link

codspeed-hq bot commented Dec 5, 2024

CodSpeed Performance Report

Merging #7685 will not alter performance

Comparing 12-05-refactor_transformer_class-properties_duplicate_object_twice_method (28ce187) with main (8883968)

Summary

✅ 29 untouched benchmarks

Copy link
Member

@Dunqing Dunqing left a comment

Choose a reason for hiding this comment

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

That's great! You are smart!

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Dec 5, 2024
Copy link
Member

Dunqing commented Dec 5, 2024

Merge activity

  • Dec 5, 6:20 PM EST: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 5, 6:20 PM EST: A user added this pull request to the Graphite merge queue.
  • Dec 5, 6:25 PM EST: A user merged this pull request with the Graphite merge queue.

…od (#7685)

Follow-up after #7664.

Generalize `duplicate_object` to produce however many duplicates are required. Use it in `transform_expression_to_wrap_nullish_check`.

This should be slightly more efficient, and will make it fool-proof if we expand `duplicate_object` later to handle other `Expression` types.
@Dunqing Dunqing force-pushed the 12-05-refactor_transformer_class-properties_duplicate_object_twice_method branch from 1617edd to 28ce187 Compare December 5, 2024 23:20
@graphite-app graphite-app bot merged commit 28ce187 into main Dec 5, 2024
24 checks passed
@graphite-app graphite-app bot deleted the 12-05-refactor_transformer_class-properties_duplicate_object_twice_method branch December 5, 2024 23:25
@overlookmotel
Copy link
Contributor Author

overlookmotel commented Dec 6, 2024

It's pretty crazy that Rust makes you use unsafe code to do something as simple as creating an array with all items initialized from a function. This should be in the standard library.

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