1
0
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:
cdwcgt 2023-07-30 02:30:11 +09:00
parent 88a1cf4005
commit 6ad8339c66
No known key found for this signature in database
GPG Key ID: 144396D01095C3A2

View File

@ -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
{