Skip to content

Apache Lucene open-source search software

LUCENE-10128: avoid costly reflection in SparseFixedBitSet ctor

Robert Muir6ac311068fef
diff --git a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
index 1155800b050..8dfb95bb127 100644
--- a/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
+++ b/lucene/core/src/java/org/apache/lucene/util/SparseFixedBitSet.java
@@ -69,7 +69,7 @@ public class SparseFixedBitSet extends BitSet {
bits = new long[blockCount][];
ramBytesUsed =
BASE_RAM_BYTES_USED
- + RamUsageEstimator.shallowSizeOf(indices)
+ + RamUsageEstimator.sizeOf(indices)
+ RamUsageEstimator.shallowSizeOf(bits);
}