misc: chore: Merge into pattern

This commit is contained in:
KeatonTheBot
2025-09-25 17:04:08 -05:00
parent a6f3f0718d
commit 48ba1cc9ed
161 changed files with 470 additions and 550 deletions
+10 -14
View File
@@ -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;
}
}