Closed yaakov-h closed 1 year 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 }).
System.Linq.Enumerable
Prepend
Append
new[] { item }.Concat(enumerable)
enumerable.Concat(new[] { item })
Since .NET Framework 4.7.1 and .NET Standard 1.6,
System.Linq.Enumerable
hasPrepend
andAppend
methods, which should (testing required) be more memory efficient thannew[] { item }.Concat(enumerable)
andenumerable.Concat(new[] { item })
.