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/SsdpCommunicationsServer.cs | |
| parent | 212976277d43a1d9a4186c6536e4a8cb3eefd639 (diff) | |
Use null propagation
Diffstat (limited to 'RSSDP/SsdpCommunicationsServer.cs')
| -rw-r--r-- | RSSDP/SsdpCommunicationsServer.cs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index 001d2a55e..768fad5ec 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -512,22 +512,16 @@ namespace Rssdp.Infrastructure } var handlers = this.RequestReceived; - if (handlers is not null) - { - handlers(this, new RequestReceivedEventArgs(data, remoteEndPoint, receivedOnlocalIPAddress)); - } + handlers?.Invoke(this, new RequestReceivedEventArgs(data, remoteEndPoint, receivedOnlocalIPAddress)); } private void OnResponseReceived(HttpResponseMessage data, IPEndPoint endPoint, IPAddress localIPAddress) { var handlers = this.ResponseReceived; - if (handlers is not null) + handlers?.Invoke(this, new ResponseReceivedEventArgs(data, endPoint) { - handlers(this, new ResponseReceivedEventArgs(data, endPoint) - { - LocalIPAddress = localIPAddress - }); - } + LocalIPAddress = localIPAddress + }); } } } |
