Grumble grumble I need to learn more C#

This commit is contained in:
nattthebear 2021-02-22 08:17:41 -05:00
parent d0c0b1fdb3
commit cec46f1e65
1 changed files with 2 additions and 2 deletions

View File

@ -548,7 +548,7 @@ namespace BizHawk.Tests.Client.Common.Movie
{
var length = r.Next(40000);
var bw = new BinaryWriter(s);
Span<byte> bytes = buff[0..length];
var bytes = buff.AsSpan(0, length);
r.NextBytes(bytes);
bw.Write(length);
bw.Write(bytes);
@ -563,7 +563,7 @@ namespace BizHawk.Tests.Client.Common.Movie
var length = info.Size;
if (length != br.ReadInt32() + 8)
throw new Exception("Length field corrupted");
Span<byte> bytes = buff[0..(length - 8)];
var bytes = buff.AsSpan(0, length - 8);
br.Read(bytes);
if (br.ReadInt32() != CRC32.Calculate(bytes))
throw new Exception("Data or CRC field corrupted");