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/SsdpDevice.cs | |
| parent | 212976277d43a1d9a4186c6536e4a8cb3eefd639 (diff) | |
Use null propagation
Diffstat (limited to 'RSSDP/SsdpDevice.cs')
| -rw-r--r-- | RSSDP/SsdpDevice.cs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.cs index 3e4261b6a..569d733ea 100644 --- a/RSSDP/SsdpDevice.cs +++ b/RSSDP/SsdpDevice.cs @@ -337,10 +337,7 @@ namespace Rssdp protected virtual void OnDeviceAdded(SsdpEmbeddedDevice device) { var handlers = this.DeviceAdded; - if (handlers != null) - { - handlers(this, new DeviceEventArgs(device)); - } + handlers?.Invoke(this, new DeviceEventArgs(device)); } /// <summary> @@ -352,10 +349,7 @@ namespace Rssdp protected virtual void OnDeviceRemoved(SsdpEmbeddedDevice device) { var handlers = this.DeviceRemoved; - if (handlers != null) - { - handlers(this, new DeviceEventArgs(device)); - } + handlers?.Invoke(this, new DeviceEventArgs(device)); } } } |
