Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
for looks better than map
  • Loading branch information
kraih committed Mar 5, 2016
1 parent f51f65c commit 612b366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Mojo/Template.pm
Expand Up @@ -75,7 +75,7 @@ sub build {
# Capture start
if ($op eq 'cpst') { $capture = 1 }
elsif ($capture) {
$blocks[-1] .= " sub { my \$_O = ''; ";
$blocks[-1] .= "sub { my \$_O = ''; ";
$capture = 0;
}
}
Expand Down Expand Up @@ -271,7 +271,7 @@ sub _wrap {
# Wrap lines
my $num = () = $code =~ /\n/g;
my $head = $self->_line(1) . "\npackage @{[$self->namespace]};";
$head .= " use Mojo::Base -strict; no warnings 'ambiguous';";
$head .= "use Mojo::Base -strict; no warnings 'ambiguous';";
$code = "$head sub { my \$_O = ''; @{[$self->prepend]}; { $code\n";
$code .= $self->_line($num + 1) . "\n@{[$self->append]}; } \$_O };";

Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Plugin/EPRenderer.pm
Expand Up @@ -34,8 +34,8 @@ sub register {

# Stash values (every time)
my $prepend = 'my $self = my $c = shift; my $_S = $c->stash; {';
$prepend .= join '',
map {" my \$$_ = \$_S->{'$_'};"} grep {/^\w+$/} keys %{$c->stash};
$prepend .= "my \$$_ = \$_S->{'$_'};"
for grep {/^\w+$/} keys %{$c->stash};
$mt->prepend($prepend . $mt->prepend)->append(';}' . $mt->append);

$cache->set($key => $mt);
Expand Down

0 comments on commit 612b366

Please sign in to comment.