1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

Use Array.Empty.

This commit is contained in:
Huo Yaoyuan 2017-09-24 03:45:46 +08:00
parent c5aebf6401
commit 87c8278139
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ namespace osu.Game.IO.Legacy
int len = ReadInt32(); int len = ReadInt32();
if (len > 0) return ReadBytes(len); if (len > 0) return ReadBytes(len);
if (len < 0) return null; if (len < 0) return null;
return new byte[0]; return Array.Empty<byte>();
} }
/// <summary> Reads a char array from the buffer, handling nulls and the array length. </summary> /// <summary> Reads a char array from the buffer, handling nulls and the array length. </summary>
@ -58,7 +58,7 @@ namespace osu.Game.IO.Legacy
int len = ReadInt32(); int len = ReadInt32();
if (len > 0) return ReadChars(len); if (len > 0) return ReadChars(len);
if (len < 0) return null; if (len < 0) return null;
return new char[0]; return Array.Empty<char>();
} }
/// <summary> Reads a DateTime from the buffer. </summary> /// <summary> Reads a DateTime from the buffer. </summary>

View File

@ -127,7 +127,7 @@ namespace osu.Game.Overlays.Mods
if (mod == null) if (mod == null)
{ {
Mods = new Mod[0]; Mods = Array.Empty<Mod>();
Alpha = 0; Alpha = 0;
} }
else else