mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 13:09:00 +00:00
Add invariant to WordMetadata
This commit is contained in:
parent
02db999762
commit
0ae4731cf1
@ -13,6 +13,12 @@ public record WordMetadata(int tfIdf,
|
||||
int positions,
|
||||
int count,
|
||||
byte flags) {
|
||||
public WordMetadata {
|
||||
if (WordMetadata.class.desiredAssertionStatus()) {
|
||||
// invariant checks go here
|
||||
assert(Integer.bitCount(positions) <= count);
|
||||
}
|
||||
}
|
||||
|
||||
public static final long COUNT_MASK = 0xFL;
|
||||
public static final int COUNT_SHIFT = 8;
|
||||
|
Loading…
Reference in New Issue
Block a user