mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-23 03:25:46 +00:00
Avoid zero-length array allocations (#427)
This commit is contained in:
parent
decd37ce6d
commit
5913ceda40
2 changed files with 4 additions and 4 deletions
|
@ -341,7 +341,7 @@ namespace Ryujinx.HLE.HOS
|
|||
{
|
||||
if (VirtualAmiibo.ApplicationBytes.Length > 0)
|
||||
{
|
||||
VirtualAmiibo.ApplicationBytes = new byte[0];
|
||||
VirtualAmiibo.ApplicationBytes = Array.Empty<byte>();
|
||||
VirtualAmiibo.InputBin = string.Empty;
|
||||
}
|
||||
if (NfpDevices[nfpDeviceId].State == NfpDeviceState.SearchingForTag)
|
||||
|
@ -356,7 +356,7 @@ namespace Ryujinx.HLE.HOS
|
|||
VirtualAmiibo.InputBin = path;
|
||||
if (VirtualAmiibo.ApplicationBytes.Length > 0)
|
||||
{
|
||||
VirtualAmiibo.ApplicationBytes = new byte[0];
|
||||
VirtualAmiibo.ApplicationBytes = Array.Empty<byte>();
|
||||
}
|
||||
byte[] encryptedData = File.ReadAllBytes(path);
|
||||
VirtualAmiiboFile newFile = AmiiboBinReader.ReadBinFile(encryptedData);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
|||
static class VirtualAmiibo
|
||||
{
|
||||
public static uint OpenedApplicationAreaId;
|
||||
public static byte[] ApplicationBytes = new byte[0];
|
||||
public static byte[] ApplicationBytes = Array.Empty<byte>();
|
||||
public static string InputBin = string.Empty;
|
||||
public static string NickName = string.Empty;
|
||||
private static readonly AmiiboJsonSerializerContext _serializerContext = AmiiboJsonSerializerContext.Default;
|
||||
|
@ -137,7 +137,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
|||
if (ApplicationBytes.Length > 0)
|
||||
{
|
||||
byte[] bytes = ApplicationBytes;
|
||||
ApplicationBytes = new byte[0];
|
||||
ApplicationBytes = Array.Empty<byte>();
|
||||
return bytes;
|
||||
}
|
||||
VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId);
|
||||
|
|
Loading…
Reference in a new issue