aboutsummaryrefslogtreecommitdiff
path: root/RSSDP/SsdpDevicePublisher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'RSSDP/SsdpDevicePublisher.cs')
-rw-r--r--RSSDP/SsdpDevicePublisher.cs14
1 files changed, 5 insertions, 9 deletions
diff --git a/RSSDP/SsdpDevicePublisher.cs b/RSSDP/SsdpDevicePublisher.cs
index a7767b3c0..be66f5947 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;
}
@@ -572,17 +571,14 @@ namespace Rssdp.Infrastructure
{
return nonzeroCacheLifetimesQuery.Min();
}
- else
- {
- return TimeSpan.Zero;
- }
+
+ return TimeSpan.Zero;
}
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();
}
@@ -644,7 +640,7 @@ namespace Rssdp.Infrastructure
public string Key
{
- get { return this.SearchTarget + ":" + this.EndPoint.ToString(); }
+ get { return this.SearchTarget + ":" + this.EndPoint; }
}
public bool IsOld()