mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-08 08:39:28 +02:00
misc: chore: Merge duplicated 'if' branches
This commit is contained in:
@@ -214,12 +214,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
DeviceType deviceType = (DeviceType)context.RequestData.ReadUInt32();
|
||||
MountTarget mountTarget = (MountTarget)context.RequestData.ReadUInt32();
|
||||
|
||||
if (deviceType != 0)
|
||||
{
|
||||
return ResultCode.WrongArgument;
|
||||
}
|
||||
|
||||
if (((uint)mountTarget & 3) == 0)
|
||||
if (deviceType != 0 || ((uint)mountTarget & 3) == 0)
|
||||
{
|
||||
return ResultCode.WrongArgument;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
{
|
||||
VirtualAmiiboFile amiiboFile = LoadAmiiboFile(amiiboId);
|
||||
|
||||
return new CommonInfo()
|
||||
return new CommonInfo
|
||||
{
|
||||
LastWriteYear = (ushort)amiiboFile.LastWriteDate.Year,
|
||||
LastWriteMonth = (byte)amiiboFile.LastWriteDate.Month,
|
||||
@@ -115,19 +115,13 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
public static bool OpenApplicationArea(string amiiboId, uint applicationAreaId)
|
||||
{
|
||||
VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId);
|
||||
if (ApplicationBytes.Length > 0)
|
||||
if (ApplicationBytes.Length > 0 ||
|
||||
virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == applicationAreaId))
|
||||
{
|
||||
OpenedApplicationAreaId = applicationAreaId;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == applicationAreaId))
|
||||
{
|
||||
OpenedApplicationAreaId = applicationAreaId;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -161,7 +155,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
return false;
|
||||
}
|
||||
|
||||
virtualAmiiboFile.ApplicationAreas.Add(new VirtualAmiiboApplicationArea()
|
||||
virtualAmiiboFile.ApplicationAreas.Add(new VirtualAmiiboApplicationArea
|
||||
{
|
||||
ApplicationAreaId = applicationAreaId,
|
||||
ApplicationArea = applicationAreaData,
|
||||
@@ -187,7 +181,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
{
|
||||
if (virtualAmiiboFile.ApplicationAreas[i].ApplicationAreaId == OpenedApplicationAreaId)
|
||||
{
|
||||
virtualAmiiboFile.ApplicationAreas[i] = new VirtualAmiiboApplicationArea()
|
||||
virtualAmiiboFile.ApplicationAreas[i] = new VirtualAmiiboApplicationArea
|
||||
{
|
||||
ApplicationAreaId = OpenedApplicationAreaId,
|
||||
ApplicationArea = applicationAreaData,
|
||||
@@ -215,7 +209,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
|
||||
}
|
||||
else
|
||||
{
|
||||
virtualAmiiboFile = new VirtualAmiiboFile()
|
||||
virtualAmiiboFile = new VirtualAmiiboFile
|
||||
{
|
||||
FileVersion = 0,
|
||||
TagUuid = [],
|
||||
|
||||
@@ -117,11 +117,8 @@ namespace Ryujinx.HLE.HOS.Services.Ro
|
||||
{
|
||||
return ResultCode.TooManyNro;
|
||||
}
|
||||
else if (nroSize == 0 || nroAddress + nroSize <= nroAddress || (nroSize & 0xFFF) != 0)
|
||||
{
|
||||
return ResultCode.InvalidSize;
|
||||
}
|
||||
else if (bssSize != 0 && bssAddress + bssSize <= bssAddress)
|
||||
else if (nroSize == 0 || nroAddress + nroSize <= nroAddress || (nroSize & 0xFFF) != 0 ||
|
||||
bssSize != 0 && bssAddress + bssSize <= bssAddress)
|
||||
{
|
||||
return ResultCode.InvalidSize;
|
||||
}
|
||||
|
||||
@@ -366,12 +366,8 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
|
||||
|
||||
int maxBufferCount = Core.GetMaxBufferCountLocked(input.Async != 0);
|
||||
|
||||
if (input.Async != 0 && Core.OverrideMaxBufferCount != 0 && Core.OverrideMaxBufferCount < maxBufferCount)
|
||||
{
|
||||
return Status.BadValue;
|
||||
}
|
||||
|
||||
if (slot < 0 || slot >= Core.Slots.Length || !Core.IsOwnedByProducerLocked(slot))
|
||||
if (input.Async != 0 && Core.OverrideMaxBufferCount != 0 && Core.OverrideMaxBufferCount < maxBufferCount ||
|
||||
slot < 0 || slot >= Core.Slots.Length || !Core.IsOwnedByProducerLocked(slot))
|
||||
{
|
||||
return Status.BadValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user