oxc/crates
overlookmotel 7d61832284 refactor(semantic): pass Rc by value (#3586)
Same as #3550.

`Rc<T>` is already a reference, so instead of passing an `&Rc<T>` to a function and then `Rc::clone()` it in the function, it's better to clone it first and pass `Rc<T>` to the function.

`Rc<T>` and `&Rc<T>` are both 8 bytes, so it introduces no additional overhead to the function call, and reduces indirection.

This is a very small optimization. Am only submitting these changes for purpose of code tidying - making the patterns around `Rc` consistent and optimal throughout the codebase.

We should probably look if we can remove some of these `Rc`s entirely and replace them with plain `&` refs. I suspect `Rc` is not actually required in most places and we're only using it to avoid dealing with lifetimes, but it's sub-optimal as `Rc::clone` has a cost, whereas copying a `&` ref has none.
2024-06-08 11:18:58 +00:00
..
oxc Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_allocator Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_ast Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_ast_macros Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_codegen Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_diagnostics Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_index Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_js_regex chore: crates should only publish src and examples directory 2024-06-08 16:35:16 +08:00
oxc_language_server chore: crates should only publish src and examples directory 2024-06-08 16:35:16 +08:00
oxc_linter chore: crates should only publish src and examples directory 2024-06-08 16:35:16 +08:00
oxc_macros chore: crates should only publish src and examples directory 2024-06-08 16:35:16 +08:00
oxc_minifier Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_module_lexer Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_parser Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_prettier chore: crates should only publish src and examples directory 2024-06-08 16:35:16 +08:00
oxc_semantic refactor(semantic): pass Rc by value (#3586) 2024-06-08 11:18:58 +00:00
oxc_sourcemap Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_span Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_syntax Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_transformer Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_traverse Release crates v0.13.5 (#3584) 2024-06-08 16:44:50 +08:00
oxc_wasm chore: crates should only publish src and examples directory 2024-06-08 16:35:16 +08:00