You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2021/06/17 12:17:26 UTC
[commons-numbers] branch master updated: Simplify comparator
function.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
The following commit(s) were added to refs/heads/master by this push:
new d56251b Simplify comparator function.
d56251b is described below
commit d56251b1f723215a9b4bb7bfb5e3f1c51dfd4186
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Thu Jun 17 14:16:11 2021 +0200
Simplify comparator function.
Thanks to Alex Herbert.
---
.../src/main/java/org/apache/commons/numbers/arrays/SortInPlace.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SortInPlace.java b/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SortInPlace.java
index 24ca473..ee160a6 100644
--- a/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SortInPlace.java
+++ b/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/SortInPlace.java
@@ -43,7 +43,7 @@ public enum SortInPlace implements BiConsumer<double[], double[][]> {
/** Sort in ascending order. */
ASCENDING((o1, o2) -> Double.compare(o1.key(), o2.key())),
/** Sort in descending order. */
- DESCENDING(ASCENDING.comparator.reversed());
+ DESCENDING((o1, o2) -> Double.compare(o2.key(), o1.key()));
/** Comparator. */
private final Comparator<PairDoubleInteger> comparator;