diff options
| author | Bond-009 <bond.009@outlook.com> | 2022-12-07 16:39:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-07 16:39:40 +0100 |
| commit | f3c57e6a0ae015dc51cf548a0380d1bed33959c2 (patch) | |
| tree | 1052ce5b7646e4fea7b20768213e89c0e38126ec /MediaBrowser.Common/Net | |
| parent | 681be595cea8254cbac5bbb3bdc9083c4780db21 (diff) | |
| parent | 52194f56b5f07e3ae01e2fb6d121452e37d1e93f (diff) | |
Merge pull request #8511 from Bond-009/isnull
Diffstat (limited to 'MediaBrowser.Common/Net')
| -rw-r--r-- | MediaBrowser.Common/Net/IPHost.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/IPNetAddress.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/IPObject.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/NetworkExtensions.cs | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/MediaBrowser.Common/Net/IPHost.cs b/MediaBrowser.Common/Net/IPHost.cs index 1f125f2b1..7cf1b8aa0 100644 --- a/MediaBrowser.Common/Net/IPHost.cs +++ b/MediaBrowser.Common/Net/IPHost.cs @@ -236,7 +236,7 @@ namespace MediaBrowser.Common.Net /// <inheritdoc/> public override bool Contains(IPAddress address) { - if (address != null && !Address.Equals(IPAddress.None)) + if (address is not null && !Address.Equals(IPAddress.None)) { if (address.IsIPv4MappedToIPv6) { diff --git a/MediaBrowser.Common/Net/IPNetAddress.cs b/MediaBrowser.Common/Net/IPNetAddress.cs index 98d1c2d97..ac3396a9f 100644 --- a/MediaBrowser.Common/Net/IPNetAddress.cs +++ b/MediaBrowser.Common/Net/IPNetAddress.cs @@ -214,7 +214,7 @@ namespace MediaBrowser.Common.Net /// <inheritdoc/> public override bool Equals(IPAddress ip) { - if (ip != null && !ip.Equals(IPAddress.None) && !Address.Equals(IPAddress.None)) + if (ip is not null && !ip.Equals(IPAddress.None) && !Address.Equals(IPAddress.None)) { return ip.Equals(Address); } diff --git a/MediaBrowser.Common/Net/IPObject.cs b/MediaBrowser.Common/Net/IPObject.cs index 37385972f..93655234b 100644 --- a/MediaBrowser.Common/Net/IPObject.cs +++ b/MediaBrowser.Common/Net/IPObject.cs @@ -292,7 +292,7 @@ namespace MediaBrowser.Common.Net /// <returns>Equality result.</returns> public virtual bool Equals(IPAddress ip) { - if (ip != null) + if (ip is not null) { if (ip.IsIPv4MappedToIPv6) { @@ -312,7 +312,7 @@ namespace MediaBrowser.Common.Net /// <returns>Equality result.</returns> public virtual bool Equals(IPObject? other) { - if (other != null) + if (other is not null) { return !Address.Equals(IPAddress.None) && Address.Equals(other.Address); } diff --git a/MediaBrowser.Common/Net/NetworkExtensions.cs b/MediaBrowser.Common/Net/NetworkExtensions.cs index 7ad005854..5e5e5b81b 100644 --- a/MediaBrowser.Common/Net/NetworkExtensions.cs +++ b/MediaBrowser.Common/Net/NetworkExtensions.cs @@ -114,7 +114,7 @@ namespace MediaBrowser.Common.Net /// <returns>True if both are equal.</returns> public static bool Compare(this Collection<IPObject> source, Collection<IPObject> dest) { - if (dest == null || source.Count != dest.Count) + if (dest is null || source.Count != dest.Count) { return false; } @@ -187,7 +187,7 @@ namespace MediaBrowser.Common.Net /// <returns>A new collection, with the items excluded.</returns> public static Collection<IPObject> Exclude(this Collection<IPObject> source, Collection<IPObject> excludeList, bool isNetwork) { - if (source.Count == 0 || excludeList == null) + if (source.Count == 0 || excludeList is null) { return new Collection<IPObject>(source); } |
