Slight Code Refactoring (#4373)
* Simplify return statements by using ternary expressions * Remove a redundant type conversion * Reduce nesting by inverting "if" statements * Try to improve code readability by using LINQ and inverting "if" statements * Try to improve code readability by using LINQ, using ternary expressions, and inverting "if" statements * Add line breaks to long LINQ * Add line breaks to long LINQ
This commit is contained in:
parent
7ca779a26d
commit
460f96967d
6 changed files with 68 additions and 106 deletions
|
@ -37,12 +37,7 @@ namespace Ryujinx.Horizon.Sm.Impl
|
|||
|
||||
result = GetServiceImpl(out handle, ref _services[serviceIndex]);
|
||||
|
||||
if (result == KernelResult.SessionCountExceeded)
|
||||
{
|
||||
return SmResult.OutOfSessions;
|
||||
}
|
||||
|
||||
return result;
|
||||
return result == KernelResult.SessionCountExceeded ? SmResult.OutOfSessions : result;
|
||||
}
|
||||
|
||||
private Result GetServiceImpl(out int handle, ref ServiceInfo serviceInfo)
|
||||
|
@ -61,13 +56,7 @@ namespace Ryujinx.Horizon.Sm.Impl
|
|||
}
|
||||
|
||||
// TODO: Validation with GetProcessInfo etc.
|
||||
|
||||
if (HasServiceInfo(name))
|
||||
{
|
||||
return SmResult.AlreadyRegistered;
|
||||
}
|
||||
|
||||
return RegisterServiceImpl(out handle, processId, name, maxSessions, isLight);
|
||||
return HasServiceInfo(name) ? SmResult.AlreadyRegistered : RegisterServiceImpl(out handle, processId, name, maxSessions, isLight);
|
||||
}
|
||||
|
||||
public Result RegisterServiceForSelf(out int handle, ServiceName name, int maxSessions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue