Skip to content

Commit

Permalink
Dry up both the two ImpactsEnum Implementation ins Lucene912PostingsR…
Browse files Browse the repository at this point in the history
…eader (apache#13892)

These two share a lot of code, in particular the impacts implementation is 100% identical.
We can save a lot of code and potentially some cycles for method invocations by
drying things up. The changes are just mechanical field movements with the following exceptions:

1. One of the two implementations was using a bytes ref builder, one a bytes ref for holding the
serialized impacts. The `BytesRef` variant is faster so I used that for both when extracting.
2. Some simple arithmetic simplifications around the levels that should be obvious.
3. Removed the the logic for an index without positions in `BlockImpactsPostingsEnum`, that was dead code,
we only set this thing up if there's positions.
  • Loading branch information
original-brownbear authored Oct 12, 2024
1 parent 3ed1d1e commit 0368614
Showing 1 changed file with 158 additions and 360 deletions.
Loading

0 comments on commit 0368614

Please sign in to comment.