Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(transformer/async-to-generator): avoid allocating unnecessar…
…y `Atom`s (#7975) Remove several `Atom` allocations from this function. 1. Take a `Cow<'a, str>` instead of `&str`, and use `AstBuilder::atom_from_cow` to avoid reallocating the string when possible. 2. Create a static `Atom` for `"_"` (no allocation required, as `"_"` is a `&'static str`). 3. `name` is an `ArenaString`, so already in arena. Convert `name` to `Atom` directly with `Atom::from`, instead of `AstBuilder::atom` (which makes a 2nd copy of the string in arena).
- Loading branch information