@@ -35,14 +35,15 @@ public class HistogramSkiplistLeafCollector extends LeafBucketCollector {
3535 private final NumericDocValues values ;
3636 private final DocValuesSkipper skipper ;
3737 private final LeafBucketCollector sub ;
38+ private final boolean isSubNoOp ;
3839 private final BucketsAggregator aggregator ;
3940
4041 /**
4142 * Supplier function to get the current preparedRounding from the parent aggregator.
4243 * This allows detection of rounding changes in AutoDateHistogramAggregator.
4344 */
4445 private final LongFunction <Rounding .Prepared > preparedRoundingSupplier ;
45- private final java . util . function . Supplier <LongKeyedBucketOrds > bucketOrdsSupplier ;
46+ private final Supplier <LongKeyedBucketOrds > bucketOrdsSupplier ;
4647 private final IncreaseRoundingIfNeeded increaseRoundingIfNeeded ;
4748
4849 /**
@@ -75,13 +76,7 @@ public HistogramSkiplistLeafCollector(
7576 LeafBucketCollector sub ,
7677 BucketsAggregator aggregator
7778 ) {
78- this .values = values ;
79- this .skipper = skipper ;
80- this .preparedRoundingSupplier = (owningBucketOrd ) -> preparedRounding ;
81- this .bucketOrdsSupplier = () -> bucketOrds ;
82- this .sub = sub ;
83- this .aggregator = aggregator ;
84- this .increaseRoundingIfNeeded = (owningBucketOrd , rounded ) -> {};
79+ this (values , skipper , (owningBucketOrd ) -> preparedRounding , () -> bucketOrds , sub , aggregator , (owningBucketOrd , rounded ) -> {});
8580 }
8681
8782 /**
@@ -101,6 +96,7 @@ public HistogramSkiplistLeafCollector(
10196 this .preparedRoundingSupplier = preparedRoundingSupplier ;
10297 this .bucketOrdsSupplier = bucketOrdsSupplier ;
10398 this .sub = sub ;
99+ this .isSubNoOp = (sub == NO_OP_COLLECTOR );
104100 this .aggregator = aggregator ;
105101 this .increaseRoundingIfNeeded = increaseRoundingIfNeeded ;
106102 }
@@ -199,7 +195,7 @@ public void collect(DocIdStream stream, long owningBucketOrd) throws IOException
199195 }
200196
201197 if (upToSameBucket ) {
202- if (sub == NO_OP_COLLECTOR ) {
198+ if (isSubNoOp ) {
203199 // stream.count maybe faster when we don't need to handle sub-aggs
204200 long count = stream .count (upToExclusive );
205201 aggregator .incrementBucketDocCount (upToBucketIndex , count );
0 commit comments