mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(btree) Add more consistent asserts on sortedness
This commit is contained in:
parent
bafc2a1f30
commit
04212b2cef
@ -123,9 +123,7 @@ public class BTreeReader {
|
|||||||
*/
|
*/
|
||||||
public long[] queryData(long[] keys, int offset) {
|
public long[] queryData(long[] keys, int offset) {
|
||||||
|
|
||||||
if (getClass().desiredAssertionStatus()) {
|
assert(isSorted(keys)) : "The input array docIds is assumed to be sorted";
|
||||||
assert(isSorted(keys));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (header.layers() == 0) {
|
if (header.layers() == 0) {
|
||||||
return queryDataNoIndex(keys, offset);
|
return queryDataNoIndex(keys, offset);
|
||||||
|
@ -41,6 +41,8 @@ public class BTreeWriter {
|
|||||||
throw new IllegalStateException("Dog ear was not overwritten: " + header);
|
throw new IllegalStateException("Dog ear was not overwritten: " + header);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert slice.isSortedN(ctx.entrySize) : "Provided data was not sorted";
|
||||||
|
|
||||||
if (header.layers() >= 1) { // Omit layer if data fits within a single block
|
if (header.layers() >= 1) { // Omit layer if data fits within a single block
|
||||||
writeIndex(header);
|
writeIndex(header);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user