diff options
| author | Stepan Goremykin <goremukin@gmail.com> | 2023-10-08 01:25:37 +0200 |
|---|---|---|
| committer | Stepan Goremykin <goremukin@gmail.com> | 2023-10-08 01:25:37 +0200 |
| commit | fdef9356b9ba483e437fbc3a2bc0b6aaf3c05c29 (patch) | |
| tree | 221c5b7b39581783557ede161187e72db68d78eb /RSSDP/SsdpDevicePublisher.cs | |
| parent | 212976277d43a1d9a4186c6536e4a8cb3eefd639 (diff) | |
Use null propagation
Diffstat (limited to 'RSSDP/SsdpDevicePublisher.cs')
| -rw-r--r-- | RSSDP/SsdpDevicePublisher.cs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.cs index d4a70a975..cdc73d552 100644 --- a/RSSDP/SsdpDevicePublisher.cs +++ b/RSSDP/SsdpDevicePublisher.cs @@ -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"); } |
