mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
Added MinOrDefault for IEnumberable<int>
This commit is contained in:
parent
aa2a3d997a
commit
25aa39e0f3
3 changed files with 41 additions and 5 deletions
|
@ -57,7 +57,7 @@ namespace NzbDrone.Core
|
|||
{
|
||||
var intList = ints.ToList();
|
||||
|
||||
if (intList.Count() == 0)
|
||||
if (!intList.Any())
|
||||
return 0;
|
||||
|
||||
return intList.Max();
|
||||
|
@ -142,5 +142,15 @@ namespace NzbDrone.Core
|
|||
|
||||
return String.Format("{0:N" + precision + "} {1}", size, suffix);
|
||||
}
|
||||
|
||||
public static int MinOrDefault(this IEnumerable<int> ints)
|
||||
{
|
||||
var intsList = ints.ToList();
|
||||
|
||||
if (!intsList.Any())
|
||||
return 0;
|
||||
|
||||
return intsList.Min();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue