You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Issue #903 the rule in my opinion correctly throws on a += for simple defined arrays using the $var = @() method of defining an array to the var variable
I would suggest that a new rule is created that correctly identifies this method as being an expensive action and that a recommendation to use a fully defined Array collection would be a better suggestion, initially suggesting using a System.Collections.ArrayList
This rule should look for both @() & += and suggest converting these calls better scripting practices
The text was updated successfully, but these errors were encountered:
I agree that we need a rule to catch the += on arrays due to the performance implications but I also agree that this issue is not really linked to the referenced issue. They are 2 separate issues to me.
Going through some past issues reveals that this seems to be a duplicate of #806. I will close this issue in the next days then but plan to do a PoC of implementing such a rule in the next 1-2 months.
In Issue #903 the rule in my opinion correctly throws on a
+=
for simple defined arrays using the$var = @()
method of defining an array to thevar
variableI would suggest that a new rule is created that correctly identifies this method as being an expensive action and that a recommendation to use a fully defined Array collection would be a better suggestion, initially suggesting using a System.Collections.ArrayList
This rule should look for both
@()
&+=
and suggest converting these calls better scripting practicesThe text was updated successfully, but these errors were encountered: