Explorar el Código

poker: remove unnecessary sorting

Frida Tveit hace 9 años
padre
commit
672fcc58da
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1
    2
      exercises/poker/src/example/java/Hand.java

+ 1
- 2
exercises/poker/src/example/java/Hand.java Ver fichero

@@ -103,8 +103,7 @@ class Hand {
103 103
         if (rankCounts.equals(Arrays.asList(2, 1, 1, 1))) {
104 104
             return 100 + highestFrequency;
105 105
         }
106
-        ranks.sort(Comparator.reverseOrder());
107
-        Collections.reverse(ranks);
106
+        ranks.sort(Comparator.naturalOrder());
108 107
         return ranks.get(0);
109 108
     }
110 109
 }