Fix CA1825 warnings on empty array initialisation.

This commit is contained in:
Matthias Mailänder
2021-12-05 13:26:40 +01:00
committed by abcdefg30
parent 727084c5fc
commit 07815143f1
85 changed files with 171 additions and 117 deletions

View File

@@ -270,7 +270,7 @@ namespace OpenRA
// Take the SHA1
if (streams.Count == 0)
return CryptoUtil.SHA1Hash(new byte[0]);
return CryptoUtil.SHA1Hash(Array.Empty<byte>());
var merged = streams[0];
for (var i = 1; i < streams.Count; i++)
@@ -471,7 +471,7 @@ namespace OpenRA
foreach (var cell in AllCells)
{
var uv = cell.ToMPos(Grid.Type);
cellProjection[uv] = new PPos[0];
cellProjection[uv] = Array.Empty<PPos>();
inverseCellProjection[uv] = new List<MPos>(1);
}
@@ -973,7 +973,7 @@ namespace OpenRA
return (PPos)CellContaining(projectedPos).ToMPos(Grid.Type);
}
static readonly PPos[] NoProjectedCells = { };
static readonly PPos[] NoProjectedCells = Array.Empty<PPos>();
public PPos[] ProjectedCellsCovering(MPos uv)
{
if (!initializedCellProjection)