Skip to content

Commit

Permalink
Don't use nqp::iterator on nqp::getsignals
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Dec 1, 2020
1 parent dce6804 commit c663cc3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/core.c/signals.pm6
@@ -1,16 +1,18 @@
my role Signal::Signally {
multi method CALL-ME(Int() $signum) { $signum ?? (nextsame) !! self }
}
my enum Signal does Signal::Signally ( |do {
my $res := nqp::list;
my $iter := nqp::iterator(nqp::getsignals);
nqp::push(
$res,
Pair.new(nqp::shift($iter), nqp::abs_i(nqp::shift($iter)))
) while $iter;
$res
}
);
my enum Signal does Signal::Signally ( BEGIN |do {
my $res := nqp::list;
my $signals := nqp::clone(nqp::getsignals);
nqp::while(
nqp::elems($signals),
nqp::push(
$res,
Pair.new(nqp::shift($signals), nqp::abs_i(nqp::shift($signals)))
)
);
$res
});

proto sub signal(|) {*}
multi sub signal(*@signals, :$scheduler = $*SCHEDULER) {
Expand Down

0 comments on commit c663cc3

Please sign in to comment.