From 65fdea7dd325b7e77bef0e5abad28c48c1a5c303 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Mon, 20 Apr 2020 00:09:35 +0200 Subject: [PATCH] Make Mu.iterator use R:I.OneValue The comment was out of date. Needs a fix in roast where defined Mu value is improperly tested for. --- src/core.c/Mu.pm6 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/core.c/Mu.pm6 b/src/core.c/Mu.pm6 index 43f26f72397..c36fd0eaf7c 100644 --- a/src/core.c/Mu.pm6 +++ b/src/core.c/Mu.pm6 @@ -50,14 +50,7 @@ my class Mu { # declared in BOOTSTRAP } proto method iterator(|) {*} - multi method iterator(Mu:) { - my $buf := nqp::create(IterationBuffer); - $buf.push(Mu); - # note: cannot use R:I.OneValue, as that doesn't (and shouldn't) - # take Mu for the value to produce, as Mu is used to indicate - # exhaustion. - Rakudo::Iterator.ReifiedList($buf) - } + multi method iterator(Mu:) { Rakudo::Iterator.OneValue(self) } proto method split(|) {*}