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:
@@ -229,7 +229,7 @@ namespace OpenRA
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
bytes = encoding.GetBytes(text);
|
||||
else
|
||||
bytes = new byte[0];
|
||||
bytes = Array.Empty<byte>();
|
||||
|
||||
s.Write(bytes.Length);
|
||||
s.WriteArray(bytes);
|
||||
|
||||
Reference in New Issue
Block a user