use Array.Empty() method.

This commit is contained in:
morkt 2018-04-07 03:06:04 +04:00
parent 9ef70bea72
commit 8e7916556c
2 changed files with 2 additions and 2 deletions

View File

@ -362,7 +362,7 @@ namespace GameRes
} }
var current_pos = Position; var current_pos = Position;
if (0 == count || current_pos >= m_size) if (0 == count || current_pos >= m_size)
return new byte[0]; return Array.Empty<byte>();
var bytes = m_view.ReadBytes (m_start+current_pos, (uint)Math.Min (count, m_size - current_pos)); var bytes = m_view.ReadBytes (m_start+current_pos, (uint)Math.Min (count, m_size - current_pos));
Position = current_pos + bytes.Length; Position = current_pos + bytes.Length;
return bytes; return bytes;

View File

@ -482,7 +482,7 @@ namespace GameRes
{ {
m_source = input.GetBuffer(); m_source = input.GetBuffer();
if (null == m_source) if (null == m_source)
m_source = new byte[0]; m_source = Array.Empty<byte>();
} }
catch (UnauthorizedAccessException) catch (UnauthorizedAccessException)
{ {