Use BinaryPrimitives.ReverseEndianness instead EndianSwap class (#832)
This PR remove the `EndianSwap` class who isn't needed anymore since .NET Core 3.0 got a buildin method `BinaryPrimitives.ReverseEndianness` who did the same thing.
This commit is contained in:
parent
cfcc360d06
commit
bb74aeae54
4 changed files with 8 additions and 36 deletions
|
@ -1,5 +1,6 @@
|
|||
using Ryujinx.Common;
|
||||
using System;
|
||||
using System.Buffers.Binary;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
|
@ -15,8 +16,8 @@ namespace Ryujinx.HLE.HOS.Services.Audio.Types
|
|||
{
|
||||
OpusPacketHeader header = reader.ReadStruct<OpusPacketHeader>();
|
||||
|
||||
header.length = EndianSwap.FromBigEndianToPlatformEndian(header.length);
|
||||
header.finalRange = EndianSwap.FromBigEndianToPlatformEndian(header.finalRange);
|
||||
header.length = BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(header.length) : header.length;
|
||||
header.finalRange = BitConverter.IsLittleEndian ? BinaryPrimitives.ReverseEndianness(header.finalRange) : header.finalRange;
|
||||
|
||||
return header;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue