Skip to content

Commit

Permalink
use a Vector as accumulator of map.traverse (#1633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Düsterhöft authored and danieldietrich committed Nov 21, 2016
1 parent 101cbe4 commit 8dc38ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javaslang/src/main/java/javaslang/collection/Map.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ default <U> U transform(Function<? super Map<K, V>, ? extends U> f) {

default <U> Seq<U> traverse(BiFunction<K, V, ? extends U> mapper) {
Objects.requireNonNull(mapper, "mapper is null");
return foldLeft(List.empty(), (acc, entry) -> acc.append(mapper.apply(entry._1, entry._2)));
return foldLeft(Vector.empty(), (acc, entry) -> acc.append(mapper.apply(entry._1, entry._2)));
}

default <T1, T2> Tuple2<Seq<T1>, Seq<T2>> unzip(BiFunction<? super K, ? super V, Tuple2<? extends T1, ? extends T2>> unzipper) {
Expand Down

0 comments on commit 8dc38ca

Please sign in to comment.