Derived from the Perflint linter.
What it does#
for loops that can be replaced by a making a copy of a list.
Why is this bad?#
When creating a copy of an existing list using a for-loop, prefer
list.copy instead. Making a direct copy is more readable and
Using the below as an example, the
list-based copy is ~2x faster on
Note that, as with all
perflint rules, this is only intended as a
micro-optimization, and will have a negligible impact on performance in