Commit 221c591
committed
docs(search): describe maxEnd as a bound, not the exact maximum
Review pointed out the comment claimed `maxEnd` is "the largest range.end
currently kept in the bucket", which stops being true the moment a
replacement swaps in a range that ends earlier - it is only ever widened.
Only the upper bound is load-bearing, so say that. A bound left too high
costs a scan that would have been skipped, never a wrong answer, and the
staleness is capped at one token length because every range spans a matched
token rather than the field.
Also records why the exact maximum is deliberately not recomputed: on the
realistic overlap shape at 10k matches, recomputing measures 45ms against
23ms as written, and 1010ms for the scan this replaced.1 parent 12c677e commit 221c591
1 file changed
Lines changed: 17 additions & 6 deletions
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
| |||
0 commit comments