dashmap icon indicating copy to clipboard operation
dashmap copied to clipboard

Avoid overallocating or growing Vec in Clone

Open GnomedDev opened this issue 6 months ago • 0 comments

We can collect directly into the Box<[T]> to avoid pushing to a Vec, which could overallocate and require a reallocation when shrinking in Vec::into_boxed_slice or have to reallocate multiple times as it wouldn't know the finishing capacity.

GnomedDev avatar Feb 13 '24 17:02 GnomedDev