mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-09 23:21:06 +02:00
misc: chore: Merge into pattern
This commit is contained in:
@@ -128,7 +128,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
|
||||
Pid = KernelContext.NewKipId();
|
||||
|
||||
if (Pid == 0 || Pid >= KernelConstants.InitialProcessId)
|
||||
if (Pid is 0 or >= KernelConstants.InitialProcessId)
|
||||
{
|
||||
throw new InvalidOperationException($"Invalid KIP Id {Pid}.");
|
||||
}
|
||||
@@ -233,7 +233,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
|
||||
Pid = KernelContext.NewProcessId();
|
||||
|
||||
if (Pid == ulong.MaxValue || Pid < KernelConstants.InitialProcessId)
|
||||
if (Pid is ulong.MaxValue or < KernelConstants.InitialProcessId)
|
||||
{
|
||||
throw new InvalidOperationException($"Invalid Process Id {Pid}.");
|
||||
}
|
||||
@@ -881,10 +881,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
{
|
||||
if (State >= ProcessState.Started)
|
||||
{
|
||||
if (State == ProcessState.Started ||
|
||||
State == ProcessState.Crashed ||
|
||||
State == ProcessState.Attached ||
|
||||
State == ProcessState.DebugSuspended)
|
||||
if (State is ProcessState.Started
|
||||
or ProcessState.Crashed
|
||||
or ProcessState.Attached
|
||||
or ProcessState.DebugSuspended)
|
||||
{
|
||||
SetState(ProcessState.Exiting);
|
||||
|
||||
@@ -922,16 +922,12 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
|
||||
lock (_processLock)
|
||||
{
|
||||
if (State >= ProcessState.Started)
|
||||
if (State is >= ProcessState.Started
|
||||
and (ProcessState.Started or ProcessState.Attached or ProcessState.DebugSuspended))
|
||||
{
|
||||
if (State == ProcessState.Started ||
|
||||
State == ProcessState.Attached ||
|
||||
State == ProcessState.DebugSuspended)
|
||||
{
|
||||
SetState(ProcessState.Exiting);
|
||||
SetState(ProcessState.Exiting);
|
||||
|
||||
shallTerminate = true;
|
||||
}
|
||||
shallTerminate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user