Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: bowenlan-amzn <[email protected]>
  • Loading branch information
bowenlan-amzn committed Jan 3, 2024
1 parent e27d57c commit e2ecd4c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ private static Weight[] createFilterForAggregations(
int bucketCount = 0;
while (roundedLow <= fieldType.convertNanosToMillis(high)) {
bucketCount++;
if (bucketCount > MAX_NUM_FILTER_BUCKETS) return null;
// Below rounding is needed as the interval could return in
// non-rounded values for something like calendar month
roundedLow = preparedRounding.round(roundedLow + interval);
Expand All @@ -148,7 +149,7 @@ private static Weight[] createFilterForAggregations(
}

Weight[] filters = null;
if (bucketCount > 0 && bucketCount <= MAX_NUM_FILTER_BUCKETS) {
if (bucketCount > 0) {
filters = new Weight[bucketCount];
roundedLow = preparedRounding.round(fieldType.convertNanosToMillis(low));

Expand Down

0 comments on commit e2ecd4c

Please sign in to comment.