We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80c75ab commit eaa03caCopy full SHA for eaa03ca
core/src/main/java/fj/P1.java
@@ -1,6 +1,6 @@
1
package fj;
2
3
-import java.lang.ref.SoftReference;
+import java.lang.ref.WeakReference;
4
5
import fj.data.Array;
6
import fj.data.List;
@@ -216,7 +216,7 @@ public P1<A> memo() {
216
final P1<A> self = this;
217
return new P1<A>() {
218
private final Object latch = new Object();
219
- private volatile SoftReference<Option<A>> v = null;
+ private volatile WeakReference<Option<A>> v = null;
220
221
@Override
222
public A _1() {
@@ -226,7 +226,7 @@ public A _1() {
226
o = v != null ? v.get() : null;
227
if (o == null) {
228
o = Option.some(self._1());
229
- v = new SoftReference<>(o);
+ v = new WeakReference<>(o);
230
}
231
232
0 commit comments