File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -209,12 +209,16 @@ public <X> P1<X> map(final F<A, X> f) {
209
209
return P .lazy (() -> f .f (self ._1 ()));
210
210
}
211
211
212
+ public P1 <A > memo () {
213
+ return softMemo ();
214
+ }
215
+
212
216
/**
213
217
* Returns a P1 that remembers its value.
214
218
*
215
219
* @return A P1 that calls this P1 once and remembers the value for subsequent calls.
216
220
*/
217
- public P1 <A > memo () { return new Memo <>(this ); }
221
+ public P1 <A > hardMemo () { return new Memo <>(this ); }
218
222
219
223
/**
220
224
* Like <code>memo</code>, but the memoized value is wrapped into a <code>WeakReference</code>
Original file line number Diff line number Diff line change @@ -1495,7 +1495,7 @@ private static final class Cons<A> extends Stream<A> {
1495
1495
1496
1496
Cons (final A head , final P1 <Stream <A >> tail ) {
1497
1497
this .head = head ;
1498
- this .tail = tail .weakMemo ();
1498
+ this .tail = tail .memo ();
1499
1499
}
1500
1500
1501
1501
public A head () {
You can’t perform that action at this time.
0 commit comments