Skip to content

Commit 9a056dc

Browse files
committed
Surely the ivar must not be re-read
1 parent 4196bb1 commit 9a056dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib-edge/concurrent/edge/erlang_actor.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,17 +660,17 @@ def initialize(mailbox, environment, name, executor)
660660

661661
def tell_op(message)
662662
log Logger::DEBUG, @Pid, told: message
663-
if @Mailbox
664-
@Mailbox.push_op(message).then { @Pid }
663+
if (mailbox = @Mailbox)
664+
mailbox.push_op(message).then { @Pid }
665665
else
666666
Promises.fulfilled_future @Pid
667667
end
668668
end
669669

670670
def tell(message, timeout = nil)
671671
log Logger::DEBUG, @Pid, told: message
672-
if @Mailbox
673-
timed_out = @Mailbox.push message, timeout
672+
if (mailbox = @Mailbox)
673+
timed_out = mailbox.push message, timeout
674674
timeout ? timed_out : @Pid
675675
else
676676
timeout ? false : @Pid

0 commit comments

Comments
 (0)