Replace == null with is null

This commit is contained in:
Bond_009
2022-12-05 15:00:20 +01:00
parent b2def4c9ea
commit c7d50d640e
206 changed files with 627 additions and 627 deletions

View File

@@ -15,8 +15,8 @@ namespace MediaBrowser.Common.Extensions
/// <returns><c>true</c> if the request is coming from LAN, <c>false</c> otherwise.</returns>
public static bool IsLocal(this HttpContext context)
{
return (context.Connection.LocalIpAddress == null
&& context.Connection.RemoteIpAddress == null)
return (context.Connection.LocalIpAddress is null
&& context.Connection.RemoteIpAddress is null)
|| Equals(context.Connection.LocalIpAddress, context.Connection.RemoteIpAddress);
}

View File

@@ -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);
}

View File

@@ -103,7 +103,7 @@ namespace MediaBrowser.Common.Plugins
get
{
// Lazy load
if (_configuration == null)
if (_configuration is null)
{
lock (_configurationSyncLock)
{

View File

@@ -43,7 +43,7 @@ namespace MediaBrowser.Common.Plugins
{
get
{
if (_version == null)
if (_version is null)
{
_version = Version.Parse(Manifest.Version);
}
@@ -85,9 +85,9 @@ namespace MediaBrowser.Common.Plugins
/// <returns>Comparison result.</returns>
public static int Compare(LocalPlugin a, LocalPlugin b)
{
if (a == null || b == null)
if (a is null || b is null)
{
throw new ArgumentNullException(a == null ? nameof(a) : nameof(b));
throw new ArgumentNullException(a is null ? nameof(a) : nameof(b));
}
var compare = string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase);
@@ -128,7 +128,7 @@ namespace MediaBrowser.Common.Plugins
/// <inheritdoc />
public bool Equals(LocalPlugin? other)
{
if (other == null)
if (other is null)
{
return false;
}