merging gsoc_breadboard changes
André Walker [Wed, 6 Jul 2011 15:24:15 +0000 (12:24 -0300)]
1  2 
lib/Catalyst.pm

diff --cc lib/Catalyst.pm
@@@ -561,10 -589,11 +561,11 @@@ sub controller 
      unshift @args, $c;
  
      if( $name ) {
+         # Direct component hash lookup to avoid costly regexps
 -        return $c->container->get_component('controller', $name, \@args)
 +        return $container->get_component($name, \@args)
              if $container->has_service($name) && !ref $name;
  
 -        return $c->_find_component_regexp( $container, $name, \@args );
 +        return $container->get_component_regexp( $c, $name, \@args );
      }
  
      return $c->component( $c->action->class );
@@@ -599,10 -628,10 +600,10 @@@ sub model 
  
      if( $name ) {
          # Direct component hash lookup to avoid costly regexps
 -        return $c->container->get_component('model', $name, \@args)
 +        return $container->get_component($name, \@args)
-             if ( !ref $name && $container->has_service($name));
+             if $container->has_service($name) && !ref $name;
  
 -        return $c->_find_component_regexp( $container, $name, \@args );
 +        return $container->get_component_regexp( $c, $name, \@args );
      }
  
      if (ref $c) {