Skip to content

Commit 443e01a

Browse files
siro-mateosjbgi
authored andcommitted
Force strict evaluation in 'TreeMap.map'.
1 parent 7417c43 commit 443e01a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/fj/data/TreeMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public P3<TreeMap<K, V>, Option<V>, TreeMap<K, V>> splitLookup(final K k) {
359359
*/
360360
@SuppressWarnings("unchecked")
361361
public <W> TreeMap<K, W> map(final F<V, W> f) {
362-
final F<P2<K, Option<V>>, P2<K, Option<W>>> g = P2.map2_(F1Functions.mapOption(f));
362+
final F<P2<K, Option<V>>, P2<K, Option<W>>> g = compose(p2 -> p(p2._1(), p2._2()), P2.map2_(F1Functions.mapOption(f)));
363363
final F<K, P2<K, Option<V>>> coord = flip(P.<K, Option<V>>p2()).f(Option.none());
364364
final Ord<K> o = tree.ord().contramap(coord);
365365
return new TreeMap<>(tree.map(TreeMap.ord(o), g));

0 commit comments

Comments
 (0)