mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
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 @@ namespace osu.Game.Tournament.IPC
|
||||
/// <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 @@ namespace osu.Game.Tournament.IPC
|
||||
string? stableInstallPath = Environment.GetEnvironmentVariable("OSU_STABLE_PATH");
|
||||
|
||||
if (ipcFileExistsInDirectory(stableInstallPath))
|
||||
return stableInstallPath!;
|
||||
return stableInstallPath;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user