Skip to content

Commit

Permalink
[Small optimization] perl compiler: Change 'my = undef;' to 'my ;'
Browse files Browse the repository at this point in the history
  • Loading branch information
perlancar committed Mar 26, 2015
1 parent ffd2fcb commit 728eeb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Data/Sah/Compiler/perl.pm
Expand Up @@ -197,7 +197,11 @@ sub block_uses_sub { 0 }

sub stmt_declare_local_var {
my ($self, $v, $vt) = @_;
"my \$$v = $vt;";
if ($vt eq 'undef') {
"my \$$v;";
} else {
"my \$$v = $vt;";
}
}

sub expr_anon_sub {
Expand Down

0 comments on commit 728eeb5

Please sign in to comment.