mirror of https://github.com/apache/lucene.git
fix bad assert
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1349622 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
476e83cd4e
commit
3b4602a94e
|
@ -104,7 +104,7 @@ class SimpleTextFieldsWriter extends FieldsConsumer {
|
|||
private final boolean writeOffsets;
|
||||
|
||||
// for assert:
|
||||
private int lastEndOffset = -1;
|
||||
private int lastStartOffset = 0;
|
||||
|
||||
public SimpleTextPostingsWriter(FieldInfo field) {
|
||||
this.indexOptions = field.getIndexOptions();
|
||||
|
@ -133,7 +133,7 @@ class SimpleTextFieldsWriter extends FieldsConsumer {
|
|||
newline();
|
||||
}
|
||||
|
||||
lastEndOffset = -1;
|
||||
lastStartOffset = 0;
|
||||
}
|
||||
|
||||
public PostingsConsumer reset(BytesRef term) {
|
||||
|
@ -152,8 +152,8 @@ class SimpleTextFieldsWriter extends FieldsConsumer {
|
|||
|
||||
if (writeOffsets) {
|
||||
assert endOffset >= startOffset;
|
||||
assert startOffset >= lastEndOffset: "startOffset=" + startOffset + " lastEndOffset=" + lastEndOffset;
|
||||
lastEndOffset = endOffset;
|
||||
assert startOffset >= lastStartOffset: "startOffset=" + startOffset + " lastStartOffset=" + lastStartOffset;
|
||||
lastStartOffset = startOffset;
|
||||
write(START_OFFSET);
|
||||
write(Integer.toString(startOffset));
|
||||
newline();
|
||||
|
|
Loading…
Reference in New Issue