Navigation Menu

Skip to content

Commit

Permalink
improved Mojolicious::Renderer performance significantly
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 17, 2012
1 parent 6da6666 commit 3cf4916
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
This file documents the revision history for Perl extension Mojolicious.

2.63 2012-03-17 00:00:00
- Improved Mojolicious::Renderer performance significantly.
- Improved documentation.

2.62 2012-03-17 00:00:00
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -214,7 +214,6 @@ sub _data_templates {
$self->{data_templates}->{$_} = $class
for keys %{Mojo::Command->new->get_all_data($class) || {}};
}

return $self->{data_templates} ||= {};
}

Expand All @@ -224,8 +223,8 @@ sub _detect_handler {
# Templates
return unless my $file = $self->template_name($options);
$file = quotemeta $file;
my $templates = $self->{templates} =
[map { @{Mojo::Home->new($_)->list_files} } @{$self->paths}];
my $templates = $self->{templates}
||= [map { @{Mojo::Home->new($_)->list_files} } @{$self->paths}];
/^$file\.(\w+)$/ and return $1 for @$templates;

# DATA templates
Expand Down

0 comments on commit 3cf4916

Please sign in to comment.