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): do not take mut ref when immut ref will do #8040

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Dec 20, 2024

Tiny refactor. Not need to take a &mut when a & will do.

Copy link
Contributor Author

overlookmotel commented Dec 20, 2024


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.

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Dec 20, 2024
@github-actions github-actions bot added the C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior label Dec 20, 2024
@overlookmotel overlookmotel marked this pull request as ready for review December 20, 2024 13:14
Copy link

codspeed-hq bot commented Dec 20, 2024

CodSpeed Performance Report

Merging #8040 will create unknown performance changes

Comparing 12-20-refactor_transformer_class-properties_do_not_take_mut_ref_when_immut_ref_will_do (98e8a72) with main (274f117)

Summary

🆕 29 new benchmarks

Benchmarks breakdown

Benchmark main 12-20-refactor_transformer_class-properties_do_not_take_mut_ref_when_immut_ref_will_do Change
🆕 codegen[checker.ts] N/A 24.8 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 74.5 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 725.5 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 24 µs N/A
🆕 lexer[antd.js] N/A 22.3 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.5 ms N/A
🆕 lexer[checker.ts] N/A 13.2 ms N/A
🆕 lexer[pdf.mjs] N/A 3.6 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.5 ms N/A
🆕 linter[cal.com.tsx] N/A 1.1 s N/A
🆕 linter[checker.ts] N/A 2.7 s N/A
🆕 minifier[antd.js] N/A 210.1 ms N/A
🆕 minifier[react.development.js] N/A 2 ms N/A
🆕 minifier[typescript.js] N/A 364.7 ms N/A
🆕 parser[RadixUIAdoptionSection.jsx] N/A 87.8 µs N/A
🆕 parser[antd.js] N/A 107.2 ms N/A
🆕 parser[cal.com.tsx] N/A 29.6 ms N/A
🆕 parser[checker.ts] N/A 54 ms N/A
🆕 parser[pdf.mjs] N/A 17.5 ms N/A
🆕 semantic[RadixUIAdoptionSection.jsx] N/A 73 µs N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Copy link

graphite-app bot commented Dec 21, 2024

Merge activity

…t ref will do (#8040)

Tiny refactor. Not need to take a `&mut` when a `&` will do.
@Boshen Boshen force-pushed the 12-20-refactor_transformer_class-properties_do_not_take_mut_ref_when_immut_ref_will_do branch from 3283cf5 to 98e8a72 Compare December 21, 2024 07:21
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 21, 2024
@graphite-app graphite-app bot merged commit 98e8a72 into main Dec 21, 2024
25 checks passed
@graphite-app graphite-app bot deleted the 12-20-refactor_transformer_class-properties_do_not_take_mut_ref_when_immut_ref_will_do branch December 21, 2024 07:27
Boshen added a commit that referenced this pull request Dec 25, 2024
## [0.44.0] - 2024-12-25

- ad2a620 ast: [**BREAKING**] Add missing
`AssignmentTargetProperty::computed` (#8097) (Boshen)

### Features

- c2daa20 ast: Add `Expression::into_inner_expression` (#8048)
(overlookmotel)
- 618b6aa codege: Minify whitespace in object getter / setter (#8080)
(Boshen)
- 4727667 codegen: Minify arrow expr `(x) => y` -> `x => y` (#8078)
(Boshen)
- 0562830 codegen: Minify string with backtick when needed (#8095)
(Boshen)
- 6237c05 codegen: Minify more whitespace (#8089) (Boshen)
- 6355b7c codegen: Minify `export { 's' as 's' }` -> `export { 's' }`
(#8093) (Boshen)
- fccfda9 codegen: Minify `class{static[computed]}` (#8088) (Boshen)
- f873139 codegen: Minify `for (_ of [])` -> `for(_ of[])` (#8086)
(Boshen)
- 8b8cbcd codegen: Minify `case "foo"` -> `case"foo"` (#8085) (Boshen)
- 414c118 codegen: Minify `yield "s"` -> `yield"s"` (#8084) (Boshen)
- f8f067b codegen: Minify class method `async*fn(){}` (#8083) (Boshen)
- 1d5ae81 codegen: Minify `const [foo] = bar` -> `const[foo]=bar`
(#8079) (Boshen)
- e3f78fb codegen: `new Foo()` -> `new Foo` when minify (#8077) (Boshen)
- d84d60a codegen: Minify numbers with large exponents (#8074) (Boshen)
- 373279b codegen: Balance string quotes when minify whitespace (#8072)
(Boshen)
- 5397fe9 minifier: Constant fold `undefined?.bar` -> `undefined`
(#8075) (Boshen)
- 1932f1e minifier: Fold `foo === undefined || foo === null` (#8063) (翠
/ green)
- 11c4bd8 span: Implement source type `{file basename}.d.{extension}.ts`
(#8109) (Boshen)
- be4feb4 syntax: Add `SymbolId::new` method (#8041) (overlookmotel)
- e632a7b transformer: Remove typescript symbols after transform (#8069)
(Boshen)

### Bug Fixes

- bdc241d codegen: Disallow template literals in object property key
(#8108) (Boshen)
- 728ed20 codegen: Print `yield * ident` correctly (Boshen)
- b605baa minifier: Constant fold strings with tab char (#8096) (Boshen)
- de82492 parser: Report syntax errors for missing constructor
implementations (#8081) (camc314)
- 55d6eb9 parser: Disallow type parameters on class constructors (#8071)
(injuly)
- be2c60d parser: Parse `import source from from 'mod'` (#8056) (Boshen)
- 708e9cf semantic: Report errors for missing class method impls (#8082)
(camc314)
- 3057686 transformer/class-properties: Unwrap parenthesised expressions
(#8049) (overlookmotel)
- e67cd05 transformer/class-properties: Correctly resolve private fields
pointing to private accessors (#8047) (overlookmotel)
- 6b08c6e transformer/class-properties: Correctly resolve private fields
pointing to private methods (#8042) (overlookmotel)
- 274f117 transformer/nullish-coalescing: Use correct scope id for
binding (#8053) (camc314)

### Performance

- 78d2e83 sourcemap: Improve perf of `search_original_line_and_column`
(#7926) (Cameron)

### Refactor

- 7110c7b codegen: Add `print_quoted_utf16` and `print_unquoted_utf16`
methods (#8107) (Boshen)
- 8b54d89 minifier: Remove parens must happen on enter (#8060) (Boshen)
- 7cb84f3 minifier: Only minify on ast node exit (#8059) (Boshen)
- 77d845a minifier: Fuse DCE AST passes (#8058) (Boshen)
- 6123f5e minifier: Fold statements on exit (#8057) (Boshen)
- cbd5169 transformer/class-properties: Do not recreate private field if
not transforming it (#8044) (overlookmotel)
- 98e8a72 transformer/class-properties: Do not take mut ref when immut
ref will do (#8040) (overlookmotel)

Co-authored-by: Boshen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

1 participant