mirror of https://github.com/apache/lucene.git
Add in the sort that was removed accidentally
This commit is contained in:
parent
d1e021055f
commit
48c3f3548e
|
@ -16,6 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.lucene.util;
|
package org.apache.lucene.util;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An implementation of a selection algorithm, ie. computing the k-th greatest value from a
|
* An implementation of a selection algorithm, ie. computing the k-th greatest value from a
|
||||||
* collection.
|
* collection.
|
||||||
|
@ -39,6 +41,7 @@ public abstract class Selector {
|
||||||
public void multiSelect(int from, int to, int[] k) {
|
public void multiSelect(int from, int to, int[] k) {
|
||||||
// k needs to be sorted, so copy the array
|
// k needs to be sorted, so copy the array
|
||||||
k = ArrayUtil.copyArray(k);
|
k = ArrayUtil.copyArray(k);
|
||||||
|
Arrays.sort(k);
|
||||||
checkMultiArgs(from, to, k);
|
checkMultiArgs(from, to, k);
|
||||||
multiSelect(from, to, k, 0, k.length);
|
multiSelect(from, to, k, 0, k.length);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue