Use null propagation

This commit is contained in:
Stepan Goremykin
2023-10-08 01:25:37 +02:00
parent 212976277d
commit fdef9356b9
9 changed files with 20 additions and 59 deletions

View File

@@ -527,10 +527,7 @@ namespace Rssdp.Infrastructure
{
var timer = _RebroadcastAliveNotificationsTimer;
_RebroadcastAliveNotificationsTimer = null;
if (timer is not null)
{
timer.Dispose();
}
timer?.Dispose();
}
private TimeSpan GetMinimumNonZeroCacheLifetime()
@@ -564,10 +561,7 @@ namespace Rssdp.Infrastructure
private void WriteTrace(string text)
{
if (LogFunction is not null)
{
LogFunction(text);
}
LogFunction?.Invoke(text);
// System.Diagnostics.Debug.WriteLine(text, "SSDP Publisher");
}