All empty arrays are not the same instance in .NET
Working a little on my side project where performance is of the essence, I was looking at a method looking like this:
1 2 3 4 |
public IEnumerable<TEntityType> GetEntities(TKey key) { return this.Lookup.GetItems(key) ?? new TEntityType[0]; } |
It got me thinking. Will .NET create… Read more »