Skip to content

Rule: Avoid += #3

Description

@clcaldwell

Avoid +=

+= is very slow, it rebuilds the array every time. This is applicable to both arrays, and to string concatenation.

Not sure if it would be worth it to try and only flag this inside of a loop, or if we want to have different severity levels for this based on whether it is in a loop.

Reference for rule recommendation: https://powershell.one/tricks/performance/arrays

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions