Fixed unnecessary zero-length array allocations

Changed all currently present zero-length array allocations in the codebase to use `Array.Empty` instead.
This commit is contained in:
penev92
2022-01-09 21:32:25 +02:00
committed by abcdefg30
parent 1312c1aa72
commit 0d24ccc47a
28 changed files with 45 additions and 34 deletions

View File

@@ -41,7 +41,7 @@ namespace OpenRA.Traits
public class ScreenMap : IWorldLoaded
{
static readonly IEnumerable<FrozenActor> NoFrozenActors = new FrozenActor[0];
static readonly IEnumerable<FrozenActor> NoFrozenActors = Array.Empty<FrozenActor>();
readonly Func<FrozenActor, bool> frozenActorIsValid = fa => fa.IsValid;
readonly Func<Actor, bool> actorIsInWorld = a => a.IsInWorld;
readonly Func<Actor, ActorBoundsPair> selectActorAndBounds;