Commit c64ee66
committed
LUCENE-10311: add long method, that forwards to int method and truncates
Confusion happens because grow(numAdds) reserves space for you to call
add() up to numAdds times.
When numAdds exceeds a "threshold" (maxdoc >> 8), we really don't care
about big numbers at all: we'll switch to a FixedBitSet(maxDoc) with
fixed sized storage, bounded only by maxDoc.
But we can just add a one-liner grow(long) that doesn't require the
caller to understand any of this, and hide it via implementation detail.1 parent ce172ec commit c64ee66
File tree
1 file changed
+15
-5
lines changed- lucene/core/src/java/org/apache/lucene/util
1 file changed
+15
-5
lines changedLines changed: 15 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
| 147 | + | |
| 148 | + | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
151 | 161 | | |
152 | | - | |
153 | | - | |
| 162 | + | |
| 163 | + | |
154 | 164 | | |
155 | 165 | | |
156 | 166 | | |
| |||
0 commit comments