move assert up to ctor

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene4547@1442798 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-02-05 23:33:46 +00:00
parent df3edbb80f
commit fc925ded1e
1 changed files with 2 additions and 1 deletions

View File

@ -278,6 +278,8 @@ public class MultiDocValues {
final OrdinalMap mapping;
MultiSortedDocValues(SortedDocValues values[], int docStarts[], OrdinalMap mapping) throws IOException {
assert values.length == mapping.ordDeltas.length;
assert docStarts.length == values.length + 1;
this.values = values;
this.docStarts = docStarts;
this.mapping = mapping;
@ -294,7 +296,6 @@ public class MultiDocValues {
public void lookupOrd(int ord, BytesRef result) {
int subIndex = (int) mapping.subIndexes.get(ord);
int segmentOrd = (int) (ord - mapping.globalOrdDeltas.get(ord));
assert subIndex < values.length;
values[subIndex].lookupOrd(segmentOrd, result);
}