mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-02 19:08:55 +02:00
misc: chore: Merge duplicated 'if' branches
This commit is contained in:
@@ -94,12 +94,8 @@ namespace Ryujinx.Memory
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
if (madvise(address, size, MADV_REMOVE) != 0)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
if (mprotect(address, size, MmapProts.PROT_NONE) != 0)
|
||||
if (madvise(address, size, MADV_REMOVE) != 0
|
||||
|| mprotect(address, size, MmapProts.PROT_NONE) != 0)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
@@ -186,12 +182,7 @@ namespace Ryujinx.Memory
|
||||
fixed (byte* pFileName = fileName)
|
||||
{
|
||||
fd = mkstemp((IntPtr)pFileName);
|
||||
if (fd == -1)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
if (unlink((IntPtr)pFileName) != 0)
|
||||
if (fd == -1 || unlink((IntPtr)pFileName) != 0)
|
||||
{
|
||||
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user