aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/SsdpDevicePublisher.cs
diff options
context:
space:
mode:
authorStepan Goremykin <goremukin@gmail.com>2023-04-06 19:21:29 +0200
committerStepan Goremykin <goremukin@gmail.com>2023-04-06 19:21:29 +0200
commitc051736c800c56767e238ccf2b93054cf5a719f1 (patch)
tree3fe5658ae33955c9cca88a5aeb4c1ee95614b1dc /RSSDP/SsdpDevicePublisher.cs
parent6ae1903453102a4bb6159b755e503ce0e0bae2f6 (diff)
Inline out variable declaration
Diffstat (limited to 'RSSDP/SsdpDevicePublisher.cs')
-rw-r--r--RSSDP/SsdpDevicePublisher.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.cs
index e073ffa96..0225d4f7d 100644
--- a/RSSDP/SsdpDevicePublisher.cs
+++ b/RSSDP/SsdpDevicePublisher.cs
@@ -244,7 +244,6 @@ namespace Rssdp.Infrastructure
// Wait on random interval up to MX, as per SSDP spec.
// Also, as per UPnP 1.1/SSDP spec ignore missing/bank MX header. If over 120, assume random value between 0 and 120.
// Using 16 as minimum as that's often the minimum system clock frequency anyway.
- int maxWaitInterval = 0;
if (String.IsNullOrEmpty(mx))
{
// Windows Explorer is poorly behaved and doesn't supply an MX header value.
@@ -254,7 +253,7 @@ namespace Rssdp.Infrastructure
// return;
}
- if (!Int32.TryParse(mx, out maxWaitInterval) || maxWaitInterval <= 0)
+ if (!Int32.TryParse(mx, out var maxWaitInterval) || maxWaitInterval <= 0)
{
return;
}
@@ -581,8 +580,7 @@ namespace Rssdp.Infrastructure
private string GetFirstHeaderValue(System.Net.Http.Headers.HttpRequestHeaders httpRequestHeaders, string headerName)
{
string retVal = null;
- IEnumerable<String> values = null;
- if (httpRequestHeaders.TryGetValues(headerName, out values) && values != null)
+ if (httpRequestHeaders.TryGetValues(headerName, out var values) && values != null)
{
retVal = values.FirstOrDefault();
}