From: André Walker Date: Wed, 6 Jul 2011 15:20:49 +0000 (-0300) Subject: style and coherence X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=56089c3b1874315737efea071b798453dbb6c8eb style and coherence --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 31f193f..12520e0 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -589,6 +589,7 @@ sub controller { unshift @args, $c; if( $name ) { + # Direct component hash lookup to avoid costly regexps return $c->container->get_component('controller', $name, \@args) if $container->has_service($name) && !ref $name; @@ -628,7 +629,7 @@ sub model { if( $name ) { # Direct component hash lookup to avoid costly regexps return $c->container->get_component('model', $name, \@args) - if ( !ref $name && $container->has_service($name)); + if $container->has_service($name) && !ref $name; return $c->_find_component_regexp( $container, $name, \@args ); }