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) {
209209 return P .lazy (() -> f .f (self ._1 ()));
210210 }
211211
212+ public P1 <A > memo () {
213+ return softMemo ();
214+ }
215+
212216 /**
213217 * Returns a P1 that remembers its value.
214218 *
215219 * @return A P1 that calls this P1 once and remembers the value for subsequent calls.
216220 */
217- public P1 <A > memo () { return new Memo <>(this ); }
221+ public P1 <A > hardMemo () { return new Memo <>(this ); }
218222
219223 /**
220224 * 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> {
14951495
14961496 Cons (final A head , final P1 <Stream <A >> tail ) {
14971497 this .head = head ;
1498- this .tail = tail .weakMemo ();
1498+ this .tail = tail .memo ();
14991499 }
15001500
15011501 public A head () {
You can’t perform that action at this time.
0 commit comments