File tree Expand file tree Collapse file tree
src/Libraries/SmartStore.Services/Search/Extensions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ namespace SmartStore.Services.Search.Extensions
88{
99 public static class FacetUtility
1010 {
11+ private const double MAX_PRICE = 1000000000 ;
12+
1113 private static int [ , ] _priceThresholds = new int [ , ]
1214 {
1315 { 10 , 5 } ,
@@ -39,23 +41,23 @@ public static double GetNextPrice(double price)
3941 return price + _priceThresholds [ i , 1 ] ;
4042 }
4143
42- return 1000000000 ;
44+ return MAX_PRICE ;
4345 }
4446
4547 public static double MakePriceEven ( double price )
4648 {
4749 if ( price == 0.0 )
4850 return GetNextPrice ( 0.0 ) ;
4951
50- // get previous threshold for price
52+ // Get previous threshold for price.
5153 var result = 0.0 ;
5254 for ( var i = 1 ; i <= _priceThresholds . GetUpperBound ( 0 ) && result == 0.0 ; ++ i )
5355 {
5456 if ( price < _priceThresholds [ i , 0 ] )
5557 result = _priceThresholds [ i - 1 , 0 ] ;
5658 }
5759
58- while ( result < price )
60+ while ( result < price && result < MAX_PRICE )
5961 {
6062 result = GetNextPrice ( result ) ;
6163 }
You can’t perform that action at this time.
0 commit comments