Skip to content

Commit 64ae49b

Browse files
committed
This is a safer order of assignment
1 parent 00c27d5 commit 64ae49b

File tree

1 file changed

+1
-2
lines changed
  • src/main/java/com/jnape/palatable/lambda/io

1 file changed

+1
-2
lines changed

src/main/java/com/jnape/palatable/lambda/io/IO.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,8 @@ class Ref {
317317
if (!ref.computed) {
318318
return monitorSync(ref, io(() -> {
319319
if (!ref.computed) {
320-
A a = io.unsafePerformIO();
320+
ref.value = io.unsafePerformIO();
321321
ref.computed = true;
322-
ref.value = a;
323322
}
324323
})).flatMap(constantly(io(() -> ref.value)));
325324
}

0 commit comments

Comments
 (0)