Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 27, 2013
1 parent d38bf39 commit cb18006
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -54,10 +54,10 @@ sub render {
$args ||= {};

# Localize "extends" and "layout"
my $partial = $args->{partial};
my $stash = $c->stash;
local $stash->{layout} = $partial ? undef : $stash->{layout};
local $stash->{extends} = $partial ? undef : $stash->{extends};
my $stash = $c->stash;
local $stash->{layout} = $stash->{layout} if exists $stash->{layout};
local $stash->{extends} = $stash->{extends} if exists $stash->{extends};
delete @{$stash}{qw(layout extends)} if my $partial = $args->{partial};

# Merge stash and arguments
@{$stash}{keys %$args} = values %$args;
Expand Down

0 comments on commit cb18006

Please sign in to comment.