Lines 157-165
Link Here
|
157 |
// acquire the in-memory indexes on the fly |
157 |
// acquire the in-memory indexes on the fly |
158 |
int length = this.indexKeys.length; |
158 |
int length = this.indexKeys.length; |
159 |
IIndex[] indexes = new IIndex[length]; |
159 |
IIndex[] indexes = new IIndex[length]; |
|
|
160 |
int count = 0; |
160 |
for (int i = 0; i < length; i++){ |
161 |
for (int i = 0; i < length; i++){ |
161 |
// may trigger some index recreation work |
162 |
// may trigger some index recreation work |
162 |
indexes[i] = indexManager.getIndex(indexKeys[i], true /*reuse index file*/, false /*do not create if none*/); |
163 |
IIndex index = indexManager.getIndex(indexKeys[i], true /*reuse index file*/, false /*do not create if none*/); |
|
|
164 |
if (index != null) indexes[count++] = index; // only consider indexes which are ready yet |
165 |
} |
166 |
if (count != length) { |
167 |
System.arraycopy(indexes, 0, indexes=new IIndex[count], 0, count); |
163 |
} |
168 |
} |
164 |
return indexes; |
169 |
return indexes; |
165 |
} |
170 |
} |