mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-17 03:33:46 +01:00
Replace == null with is null
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace MediaBrowser.Common.Plugins
|
||||
get
|
||||
{
|
||||
// Lazy load
|
||||
if (_configuration == null)
|
||||
if (_configuration is null)
|
||||
{
|
||||
lock (_configurationSyncLock)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user