New lint: vec.extend(&vec![elem; len]) is slow, vec.resize() should be used instead #4660
Labels
A-lint
Area: New lints
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
L-perf
Lint: Belongs in the perf lint group
L-suggestion
Lint: Improving, adding or fixing lint suggestions
There are some very slow ways of extending a vector with
len
new elements:Instead it should be written like this:
This sounds like code that nobody would ever write, but it actually has real-world precedent: Frommi/miniz_oxide#55
The text was updated successfully, but these errors were encountered: