double[] doubles;
if (length < VALUE_CACHE_SIZE) {
doubles = doublesValuesCache.get().get()[length];
} else {
doubles = new double[length];
<BUG>}
int i = 0;
for (int[] ordinal : ordinals) {
int loc = ordinal[docId];
if (loc != 0) {
doubles[i++] = values[loc];

}</BUG>
}

double[] doubles;
if (length < VALUE_CACHE_SIZE) {
doubles = doublesValuesCache.get().get()[length];
} else {
doubles = new double[length];
}
for (int i = 0; i < length; i++) {
doubles[i] = values[ordinals[i][docId]];
}
