Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(transformer/class-properties): re-use existing
Vec
(#7854)
Follow-on after #7831. Previously this code was: 1. Create a new empty `Vec` (in `move_vec` call). 2. Consume the old `Vec` and create a new `Vec<ArrayExpressionElement>`. 3. Push to the empty `Vec` created in step 1. Instead: 1. Drain the old `Vec` and create a new `Vec<ArrayExpressionElement>`. 2. The old `Vec` is now empty, but still holds an allocation if it wasn't empty before. 3. Push to the old `Vec` (re-using the existing allocation). i.e. We create 1 less `Vec`, and re-use an existing allocation if possible.
- Loading branch information