jellyfin/MediaBrowser.Model/Dlna/SortCriteria.cs
Bond_009 24a7e210c3 Optimize tryparse
* Don't check for null before
* Don't try different formats when not needed (NumberFormat.Integer is the fast path)
2023-02-19 16:52:29 +01:00

25 lines
514 B
C#

#pragma warning disable CS1591
using System;
using Jellyfin.Data.Enums;
namespace MediaBrowser.Model.Dlna
{
public class SortCriteria
{
public SortCriteria(string sortOrder)
{
if (Enum.TryParse<SortOrder>(sortOrder, true, out var sortOrderValue))
{
SortOrder = sortOrderValue;
}
else
{
SortOrder = SortOrder.Ascending;
}
}
public SortOrder SortOrder { get; }
}
}