Skip to content

Commit 2bb1f45

Browse files
committed
[Truffle] Fix last commit ArrayUtils.extractRange.
1 parent 2f08382 commit 2bb1f45

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/main/java/org/jruby/truffle/runtime/util/ArrayUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public abstract class ArrayUtils {
2525
* @param end the end index (exclusive), must be >= 0 and <= source.length and >= start
2626
* @return a newly allocated array with the extracted elements and length (end - start)
2727
*/
28-
public static Object[] extractRange(int[] source, int start, int end) {
28+
public static int[] extractRange(int[] source, int start, int end) {
2929
assert checkExtractRangeArgs(source, start, end);
3030
int length = end - start;
31-
Object[] result = new Object[length];
31+
int[] result = new int[length];
3232
System.arraycopy(source, start, result, 0, length);
3333
return result;
3434
}
@@ -49,10 +49,10 @@ private static boolean checkExtractRangeArgs(int[] source, int start, int end) {
4949
* @param end the end index (exclusive), must be >= 0 and <= source.length and >= start
5050
* @return a newly allocated array with the extracted elements and length (end - start)
5151
*/
52-
public static Object[] extractRange(long[] source, int start, int end) {
52+
public static long[] extractRange(long[] source, int start, int end) {
5353
assert checkExtractRangeArgs(source, start, end);
5454
int length = end - start;
55-
Object[] result = new Object[length];
55+
long[] result = new long[length];
5656
System.arraycopy(source, start, result, 0, length);
5757
return result;
5858
}
@@ -73,10 +73,10 @@ private static boolean checkExtractRangeArgs(long[] source, int start, int end)
7373
* @param end the end index (exclusive), must be >= 0 and <= source.length and >= start
7474
* @return a newly allocated array with the extracted elements and length (end - start)
7575
*/
76-
public static Object[] extractRange(double[] source, int start, int end) {
76+
public static double[] extractRange(double[] source, int start, int end) {
7777
assert checkExtractRangeArgs(source, start, end);
7878
int length = end - start;
79-
Object[] result = new Object[length];
79+
double[] result = new double[length];
8080
System.arraycopy(source, start, result, 0, length);
8181
return result;
8282
}

0 commit comments

Comments
 (0)