Skip to content

Commit

Permalink
just a tiny and ineffective micro-optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Mar 1, 2015
1 parent b8aa076 commit a6746fa
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Perl6/Actions.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -6979,10 +6979,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
%curried{'&postcircumfix:<{ }>'} := 2;
}
method whatever_curry($/, $past, $upto_arity) {
my $Whatever := $*W.find_symbol(['Whatever']);
my $WhateverCode := $*W.find_symbol(['WhateverCode']);
my $HyperWhatever := $*W.find_symbol(['HyperWhatever']);
my $curried :=
my int $curried :=
# It must be an op and...
nqp::istype($past, QAST::Op) && (

Expand All @@ -7002,10 +6999,18 @@ class Perl6::Actions is HLL::Actions does STDActions {
|| ($past.op eq 'call' && nqp::eqat($past.name, '&postcircumfix:', 0) &&
%curried{$past.name} // 0)
);

return $past unless $curried;

my int $i := 0;
my int $whatevers := 0;
my int $hyperwhatever := 0;
while $curried && $i < $upto_arity {

my $Whatever := $*W.find_symbol(['Whatever']);
my $WhateverCode := $*W.find_symbol(['WhateverCode']);
my $HyperWhatever := $*W.find_symbol(['HyperWhatever']);

while $i < $upto_arity {
my $check := $past[$i];
$check := $check[0] if (nqp::istype($check, QAST::Stmts) ||
nqp::istype($check, QAST::Stmt)) &&
Expand Down

0 comments on commit a6746fa

Please sign in to comment.