Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Small optimization to not gerenate too many "null"s

Uwe Schindler1ecbbd2877a3
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java b/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java
index 5cea0ff6209..06ee01bc5b1 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/BulkOperation.java
@@ -126,38 +126,6 @@ abstract class BulkOperation implements PackedInts.Decoder, PackedInts.Encoder {
null,
null,
new BulkOperationPackedSingleBlock32(),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
};
diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/gen_BulkOperation.py b/lucene/core/src/java/org/apache/lucene/util/packed/gen_BulkOperation.py
index 5abbd176f3c..239bd918d19 100644
--- a/lucene/core/src/java/org/apache/lucene/util/packed/gen_BulkOperation.py
+++ b/lucene/core/src/java/org/apache/lucene/util/packed/gen_BulkOperation.py
@@ -436,7 +436,7 @@ if __name__ == '__main__':
f.write(' // NOTE: this is sparse (some entries are null):\n')
f.write(' private static final BulkOperation[] packedSingleBlockBulkOps = new BulkOperation[] {\n')
- for bpv in xrange(1, 65):
+ for bpv in xrange(1, max(PACKED_64_SINGLE_BLOCK_BPV)+1):
if bpv in PACKED_64_SINGLE_BLOCK_BPV:
f2 = open('BulkOperationPackedSingleBlock%d.java' % bpv, 'w')
f2.write(HEADER)