Skip to content

Commit f3f475f

Browse files
committed
Check min_doc_id/max_doc_id first in hasNewerVersion
1 parent 9b90a3e commit f3f475f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/segment_list.zig

+4-2
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ pub fn SegmentList(Segment: type) type {
159159
i -= 1;
160160
const node = self.nodes.items[i];
161161
if (node.value.info.version > version) {
162-
if (node.value.docs.contains(doc_id)) {
163-
return true;
162+
if (doc_id >= node.value.min_doc_id and doc_id <= node.value.max_doc_id) {
163+
if (node.value.docs.contains(doc_id)) {
164+
return true;
165+
}
164166
}
165167
} else {
166168
break;

0 commit comments

Comments
 (0)