Skip to content

Commit ce2fde3

Browse files
committed
Remove use of return outside a routine
After rakudo upgrade it now correctly says: Attempt to return outside of immediately-enclosing Routine And I'm surprised it didn't cause any issues before.
1 parent dc02c9d commit ce2fde3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Whateverable/Replaceable.pm6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ method make-believe($msg, @nicks, &play, :$timeout = 4) {
3535
start {
3636
my %*BOT-ENV = $x; # TODO … yeah, I don't know
3737
await Promise.anyof: $update-promise, Promise.in: $timeout;
38-
$!users-lock.protect: {
39-
return if any %!users{$msg.channel}{@nicks}:exists
38+
my @found-nicks = $!users-lock.protect: {
39+
%!users{$msg.channel}{@nicks}:exists
4040
}
41-
try {
41+
if @found-nicks.none {
4242
$msg.reply: $_ but Reply($msg) with play;
4343
CATCH { default { $msg.reply: self.handle-exception: $_, $msg } }
4444
}

0 commit comments

Comments
 (0)