improved performance of item counts

This commit is contained in:
Luke Pulverenti
2013-09-11 13:54:59 -04:00
parent 1496991096
commit 803e8b4a2e
49 changed files with 496 additions and 380 deletions

View File

@@ -14,7 +14,12 @@ namespace MediaBrowser.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
return (x.Budget ?? 0).CompareTo(y.Budget ?? 0);
return GetValue(x).CompareTo(GetValue(y));
}
private double GetValue(BaseItem x)
{
return x.Budget ?? 0;
}
/// <summary>

View File

@@ -17,7 +17,12 @@ namespace MediaBrowser.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
return (x.CriticRating ?? 0).CompareTo(y.CriticRating ?? 0);
return GetValue(x).CompareTo(GetValue(y));
}
private float GetValue(BaseItem x)
{
return x.CriticRating ?? 0;
}
/// <summary>

View File

@@ -14,7 +14,12 @@ namespace MediaBrowser.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
return (x.Revenue ?? 0).CompareTo(y.Revenue ?? 0);
return GetValue(x).CompareTo(GetValue(y));
}
private double GetValue(BaseItem x)
{
return x.Revenue ?? 0;
}
/// <summary>