Fix some warnings

This commit is contained in:
Bond_009
2021-11-15 15:57:07 +01:00
parent 9c74103fbe
commit 474b035d99
15 changed files with 36 additions and 32 deletions

View File

@@ -26,7 +26,7 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem? x, BaseItem? y)
{
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
return string.Compare(GetValue(x), GetValue(y), StringComparison.OrdinalIgnoreCase);
}
/// <summary>

View File

@@ -25,7 +25,7 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem? x, BaseItem? y)
{
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
return string.Compare(GetValue(x), GetValue(y), StringComparison.OrdinalIgnoreCase);
}
/// <summary>
@@ -35,9 +35,7 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>System.String.</returns>
private static string? GetValue(BaseItem? x)
{
var audio = x as Audio;
return audio == null ? string.Empty : audio.Album;
return x is Audio audio ? audio.Album : string.Empty;
}
}
}

View File

@@ -17,7 +17,7 @@ namespace Emby.Server.Implementations.Sorting
/// <inheritdoc />
public int Compare(BaseItem? x, BaseItem? y)
{
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
return string.Compare(GetValue(x), GetValue(y), StringComparison.OrdinalIgnoreCase);
}
/// <summary>

View File

@@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Sorting
throw new ArgumentNullException(nameof(y));
}
return string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase);
return string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
}
}
}

View File

@@ -25,7 +25,7 @@ namespace Emby.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
return string.Compare(GetValue(x), GetValue(y), StringComparison.CurrentCultureIgnoreCase);
return string.Compare(GetValue(x), GetValue(y), StringComparison.OrdinalIgnoreCase);
}
private static string GetValue(BaseItem item)

View File

@@ -36,7 +36,7 @@ namespace Emby.Server.Implementations.Sorting
throw new ArgumentNullException(nameof(y));
}
return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase);
return string.Compare(x.SortName, y.SortName, StringComparison.OrdinalIgnoreCase);
}
}
}