Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
loop { } doesn't need to inspect lexical "True" each iteration
  • Loading branch information
timo committed Nov 26, 2014
1 parent e1aa077 commit cd9001e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Perl6/Actions.nqp
Expand Up @@ -1052,7 +1052,7 @@ class Perl6::Actions is HLL::Actions does STDActions {

method statement_control:sym<loop>($/) {
my $block := pblock_immediate($<block>.ast);
my $cond := $<e2> ?? $<e2>.ast !! QAST::Var.new(:name<True>, :scope<lexical>);
my $cond := $<e2> ?? $<e2>.ast !! QAST::IVal.new( :value(1) );
my $loop := QAST::Op.new( $cond, :op('while'), :node($/) );
$loop.push($block);
if $<e3> {
Expand Down

0 comments on commit cd9001e

Please sign in to comment.