diff --git a/processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryEngine.java b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryEngine.java index a24f6e268f2..9489e400a6e 100644 --- a/processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryEngine.java +++ b/processing/src/main/java/io/druid/query/timeseries/TimeseriesQueryEngine.java @@ -60,28 +60,9 @@ public class TimeseriesQueryEngine { Aggregator[] aggregators = QueryRunnerHelper.makeAggregators(cursor, aggregatorSpecs); try { - final int aggSize = aggregators.length; - final int aggExtra = aggSize % AGG_UNROLL_COUNT; - while (!cursor.isDone()) { - switch(aggExtra) { - case 7: aggregators[6].aggregate(); - case 6: aggregators[5].aggregate(); - case 5: aggregators[4].aggregate(); - case 4: aggregators[3].aggregate(); - case 3: aggregators[2].aggregate(); - case 2: aggregators[1].aggregate(); - case 1: aggregators[0].aggregate(); - } - for (int j = aggExtra; j < aggSize; j += AGG_UNROLL_COUNT) { - aggregators[j].aggregate(); - aggregators[j+1].aggregate(); - aggregators[j+2].aggregate(); - aggregators[j+3].aggregate(); - aggregators[j+4].aggregate(); - aggregators[j+5].aggregate(); - aggregators[j+6].aggregate(); - aggregators[j+7].aggregate(); + for(Aggregator aggregator : aggregators) { + aggregator.aggregate(); } cursor.advance(); }