mirror of https://github.com/ppy/osu
use no null when true
This commit is contained in:
parent
88a1cf4005
commit
6ad8339c66
|
@ -2,6 +2,7 @@
|
|||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.Win32;
|
||||
|
@ -180,7 +181,7 @@ public bool SetIPCLocation(string? path)
|
|||
/// <returns>Whether an IPC directory was successfully auto-detected.</returns>
|
||||
public bool AutoDetectIPCLocation() => SetIPCLocation(findStablePath());
|
||||
|
||||
private static bool ipcFileExistsInDirectory(string? p) => p != null && File.Exists(Path.Combine(p, "ipc.txt"));
|
||||
private static bool ipcFileExistsInDirectory([NotNullWhen(true)] string? p) => p != null && File.Exists(Path.Combine(p, "ipc.txt"));
|
||||
|
||||
private string? findStablePath()
|
||||
{
|
||||
|
@ -201,7 +202,7 @@ public bool SetIPCLocation(string? path)
|
|||
string? stableInstallPath = Environment.GetEnvironmentVariable("OSU_STABLE_PATH");
|
||||
|
||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||
return stableInstallPath!;
|
||||
return stableInstallPath;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue