File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
examples/src/main/java/com/github/underscore/examples
src/main/java/com/github/underscore Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 3232 */
3333public class Xor {
3434 public static <E > List <E > uniq (final List <E > list ) {
35- return new ArrayList <E >(new HashSet <E >(list ));
35+ return new ArrayList <E >(new LinkedHashSet <E >(list ));
3636 }
3737
3838 public static <E > Optional <E > find (final Iterable <E > iterable , final Predicate <E > pred ) {
Original file line number Diff line number Diff line change @@ -1041,7 +1041,7 @@ public static <E> E[] without(final E[] array, final E ... values) {
10411041 }
10421042
10431043 public static <E > List <E > uniq (final List <E > list ) {
1044- return newArrayList (newHashSet (list ));
1044+ return newArrayList (newLinkedHashSet (list ));
10451045 }
10461046
10471047 @ SuppressWarnings ("unchecked" )
@@ -2495,8 +2495,8 @@ protected static <T> Set<T> newLinkedHashSet() {
24952495 }
24962496
24972497 @ SuppressWarnings ("unchecked" )
2498- protected static <T > Set <T > newHashSet (Iterable <T > iterable ) {
2499- final Set <T > result = new HashSet <T >();
2498+ protected static <T > Set <T > newLinkedHashSet (Iterable <T > iterable ) {
2499+ final Set <T > result = new LinkedHashSet <T >();
25002500 for (final T item : iterable ) {
25012501 result .add (item );
25022502 }
You can’t perform that action at this time.
0 commit comments