Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't let parens prevent "for (1..1000) { }" opt.
  • Loading branch information
jnthn committed Aug 14, 2014
1 parent 88326ed commit 758974b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Perl6/Optimizer.nqp
Expand Up @@ -994,7 +994,11 @@ class Perl6::Optimizer {
if $optype eq 'callmethod' && $op.name eq 'sink' &&
nqp::istype($op[0], QAST::Op) && $op[0].op eq 'callmethod' && $op[0].name eq 'map' && @($op[0]) == 2 &&
nqp::istype((my $c1 := $op[0][0]), QAST::Op) && $c1.name eq '&infix:<,>' &&
nqp::istype((my $c2 := $op[0][0][0]), QAST::Op) && nqp::existskey(%range_bounds, $c2.name) &&
(nqp::istype((my $c2 := $op[0][0][0]), QAST::Op) &&
nqp::existskey(%range_bounds, $c2.name)
|| nqp::istype($op[0][0][0], QAST::Stmts) &&
nqp::istype(($c2 := $op[0][0][0][0]), QAST::Op) &&
nqp::existskey(%range_bounds, $c2.name)) &&
$!symbols.is_from_core($c2.name) {
self.optimize_for_range($op, $c2);
self.visit_op_children($op);
Expand Down

0 comments on commit 758974b

Please sign in to comment.