WiseTechGlobal / WTG.Analyzers

Analyzers from WiseTech Global to enforce our styles, behaviours, and prevent common mistakes.
Other
16 stars 3 forks source link

Analyzer to warn against Concat with new single-element array #134

Closed yaakov-h closed 1 year ago

yaakov-h commented 3 years ago

Since .NET Framework 4.7.1 and .NET Standard 1.6, System.Linq.Enumerable has Prepend and Append methods, which should (testing required) be more memory efficient than new[] { item }.Concat(enumerable) and enumerable.Concat(new[] { item }).