Skip to content

Commit 17b42bc

Browse files
committed
refactor WeightedKendallTauDistance
1 parent cf0bbf8 commit 17b42bc

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/main/java/org/cicirello/permutations/distance/WeightedKendallTauDistance.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* JavaPermutationTools: A Java library for computation on permutations and sequences.
3-
* Copyright (C) 2018-2022 Vincent A. Cicirello, <https://www.cicirello.org/>.
3+
* Copyright (C) 2018-2023 Vincent A. Cicirello, <https://www.cicirello.org/>.
44
*
55
* This file is part of JavaPermutationTools (https://jpt.cicirello.org/).
66
*
@@ -149,16 +149,8 @@ private double merge(int[] array, double[] w, int first, int midPlus, int lastPl
149149
k++;
150150
}
151151
}
152-
while (i < left.length) {
153-
array[k] = left[i];
154-
i++;
155-
k++;
156-
}
157-
while (j < right.length) {
158-
array[k] = right[j];
159-
j++;
160-
k++;
161-
}
152+
System.arraycopy(left, i, array, k, left.length - i);
153+
System.arraycopy(right, j, array, k, right.length - j);
162154
return weightedCount;
163155
}
164156
}

0 commit comments

Comments
 (0)