diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-11 13:54:59 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-09-11 13:54:59 -0400 |
| commit | 803e8b4a2eb5fcf1b5a3679fe551d541620d4743 (patch) | |
| tree | 8d070a411db7406fe5e7f30e03feefe83ad7127d /MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs | |
| parent | 1496991096c4db9f69bc572aeefc8099ca0f0c01 (diff) | |
improved performance of item counts
Diffstat (limited to 'MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs b/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs index 8764c97d0..e9d7912a1 100644 --- a/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs +++ b/MediaBrowser.Server.Implementations/Sorting/RevenueComparer.cs @@ -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> |
