[Catalyst-commits] r7932 - in Catalyst-Plugin-SmartURI/1.000/trunk:
. lib/Catalyst/Plugin
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Tue Jun 17 06:21:41 BST 2008
Author: caelum
Date: 2008-06-17 06:21:41 +0100 (Tue, 17 Jun 2008)
New Revision: 7932
Modified:
Catalyst-Plugin-SmartURI/1.000/trunk/Changes
Catalyst-Plugin-SmartURI/1.000/trunk/META.yml
Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm
Log:
Minor speedup.
Modified: Catalyst-Plugin-SmartURI/1.000/trunk/Changes
===================================================================
--- Catalyst-Plugin-SmartURI/1.000/trunk/Changes 2008-06-16 23:54:50 UTC (rev 7931)
+++ Catalyst-Plugin-SmartURI/1.000/trunk/Changes 2008-06-17 05:21:41 UTC (rev 7932)
@@ -8,3 +8,6 @@
0.02 2008-06-03 21:58:17
Moved Catalyst::SmartURI into a separate dist as URI::SmartURI
+
+0.021 2008-06-16 22:20:42
+ Minor speedup, avoiding unnecessary string evals.
Modified: Catalyst-Plugin-SmartURI/1.000/trunk/META.yml
===================================================================
--- Catalyst-Plugin-SmartURI/1.000/trunk/META.yml 2008-06-16 23:54:50 UTC (rev 7931)
+++ Catalyst-Plugin-SmartURI/1.000/trunk/META.yml 2008-06-17 05:21:41 UTC (rev 7932)
@@ -5,7 +5,7 @@
build_requires:
Test::More: 0
distribution_type: module
-generated_by: 'Module::Install version 0.71'
+generated_by: 'Module::Install version 0.72'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
@@ -21,4 +21,4 @@
Class::C3::Componentised: 0
Class::Data::Inheritable: 0
URI::SmartURI: 0
-version: 0.02
+version: 0.021
Modified: Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm
===================================================================
--- Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm 2008-06-16 23:54:50 UTC (rev 7931)
+++ Catalyst-Plugin-SmartURI/1.000/trunk/lib/Catalyst/Plugin/SmartURI.pm 2008-06-17 05:21:41 UTC (rev 7932)
@@ -14,7 +14,7 @@
=cut
-our $VERSION = '0.02';
+our $VERSION = '0.021';
=head1 SYNOPSIS
@@ -150,14 +150,19 @@
$app->next::method(@_)
}
+{
+my %loaded;
+
sub prepare_uri {
my ($c, $uri) = @_;
my $disposition = $c->uri_disposition;
+ my $uri_class = $c->uri_class;
- eval 'require '.$c->uri_class;
+ eval "require $uri_class",$loaded{$uri_class}++ unless $loaded{$uri_class};
- $c->uri_class->new($uri, { reference => $c->req->uri })->$disposition
+ $uri_class->new($uri, { reference => $c->req->uri })->$disposition
}
+}
# Reset accessors to configured values at beginning of request.
sub prepare {
More information about the Catalyst-commits
mailing list