X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=60d8a3c76e39191d8eef87d4677e5d4895f1d6ca;hb=56cf18648867ed69585864babff6956b3b630cb7;hp=b8e62cf3830e126695f2d742f90b87cb27583daf;hpb=ff974a7ca636b3fb90ed3d6f8f62576dad523be5;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index b8e62cf..60d8a3c 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -658,14 +658,11 @@ sub view { unshift @args, $c; if( $name ) { - if ( !ref $name ) { # Direct component hash lookup to avoid costly regexps - if ( $container->has_service($name) ) { - return $container->get_component($name, \@args); - } - else { - $c->log->warn( "Attempted to use view '$name', but does not exist" ); - } - } + # Direct component hash lookup to avoid costly regexps + return $container->get_component($name, \@args) + if !ref $name && $container->has_service($name); + + $c->log->warn( "Attempted to use view '$name', but does not exist" ); return $container->get_component_regexp( $c, $name, \@args ); }