mirror of https://github.com/apache/lucene.git
LUCENE-6890: update TODOs; remove dead code from test case; improve javadocs
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1713684 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
148b453949
commit
f25c890709
|
@ -382,8 +382,8 @@ public abstract class StringHelper {
|
|||
}
|
||||
|
||||
/** Compares a fixed length slice of two byte arrays interpreted as
|
||||
* unsigned values. Returns positive int if a > b, negative
|
||||
* int if a < b and 0 if a == b */
|
||||
* big-endian unsigned values. Returns positive int if a > b,
|
||||
* negative int if a < b and 0 if a == b */
|
||||
public static int compare(int count, byte[] a, int aOffset, byte[] b, int bOffset) {
|
||||
for(int i=0;i<count;i++) {
|
||||
int cmp = (a[aOffset+i]&0xff) - (b[bOffset+i]&0xff);
|
||||
|
|
|
@ -129,8 +129,6 @@ public class BKDReader implements Accountable {
|
|||
int count = in.readVInt();
|
||||
visitor.grow(count);
|
||||
|
||||
// TODO: especially for the 1D case, this was a decent speedup, because caller could know it should budget for around XXX docs:
|
||||
//state.docs.grow(count);
|
||||
for(int i=0;i<count;i++) {
|
||||
visitor.visit(in.readInt());
|
||||
}
|
||||
|
@ -142,9 +140,6 @@ public class BKDReader implements Accountable {
|
|||
// How many points are stored in this leaf cell:
|
||||
int count = in.readVInt();
|
||||
|
||||
// TODO: we could maybe pollute the IntersectVisitor API with a "grow" method if this maybe helps perf
|
||||
// enough (it did before, esp. for the 1D case):
|
||||
//state.docs.grow(count);
|
||||
for(int i=0;i<count;i++) {
|
||||
docIDs[i] = in.readInt();
|
||||
}
|
||||
|
|
|
@ -474,6 +474,8 @@ public class BKDWriter implements Closeable {
|
|||
|
||||
out.writeVInt(leafBlockFPs.length);
|
||||
|
||||
// TODO: for 1D case, don't waste the first byte of each split value (it's always 0)
|
||||
|
||||
// NOTE: splitPackedValues[0] is unused, because nodeID is 1-based:
|
||||
out.writeBytes(splitPackedValues, 0, splitPackedValues.length);
|
||||
|
||||
|
|
|
@ -50,7 +50,6 @@ import org.apache.lucene.index.Term;
|
|||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.MockDirectoryWrapper;
|
||||
import org.apache.lucene.util.BytesRef;
|
||||
import org.apache.lucene.util.FixedBitSet;
|
||||
import org.apache.lucene.util.IOUtils;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.TestUtil;
|
||||
|
@ -90,24 +89,11 @@ public class TestDimensionalRangeQuery extends LuceneTestCase {
|
|||
int numValues = atLeast(10000);
|
||||
long value = randomValue(false);
|
||||
long[] values = new long[numValues];
|
||||
FixedBitSet missing = new FixedBitSet(numValues);
|
||||
|
||||
if (VERBOSE) {
|
||||
System.out.println("TEST: use same value=" + value);
|
||||
}
|
||||
|
||||
for(int docID=0;docID<numValues;docID++) {
|
||||
int x = random().nextInt(20);
|
||||
if (x == 17) {
|
||||
// Some docs don't have a point:
|
||||
missing.set(docID);
|
||||
if (VERBOSE) {
|
||||
System.out.println(" doc=" + docID + " is missing");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
values[docID] = value;
|
||||
}
|
||||
Arrays.fill(values, value);
|
||||
|
||||
verifyLongs(values, null);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue