You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by dnhatn <gi...@git.apache.org> on 2018/12/06 04:14:35 UTC
[GitHub] lucene-solr pull request #515: LUCENE-8593: Specialize single value numeric ...
Github user dnhatn commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/515#discussion_r239323491
--- Diff: lucene/core/src/java/org/apache/lucene/index/DocValuesFieldUpdates.java ---
@@ -425,4 +425,51 @@ final boolean hasValue() {
return hasValue;
}
}
+
+ static abstract class SingleValueDocValuesFieldUpdates extends DocValuesFieldUpdates {
+
+ protected SingleValueDocValuesFieldUpdates(int maxDoc, long delGen, String field, DocValuesType type) {
+ super(maxDoc, delGen, field, type);
+ }
+
+ @Override
+ void add(int doc, long value) {
+ super.add(doc);
+ assert longValue() == value;
+ }
+
+ @Override
+ void add(int doc, BytesRef value) {
+ super.add(doc);
+ assert binaryValue().equals(value);
--- End diff --
I think this assert should be moved up.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org