From: Matt S Trout Date: Sun, 18 Jun 2006 22:24:23 +0000 (+0000) Subject: removed retarded registration requirement in dispatcher X-Git-Tag: 5.7099_04~511 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=9a6ecf4f8186b42c4c86206b20435c60dc03e012 removed retarded registration requirement in dispatcher --- diff --git a/Changes b/Changes index 4fb1336..04a144d 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ This file documents the revision history for Perl extension Catalyst. + - removed retarded registration requirement in dispatcher - removed Module::Pluggable::Fast hack in favor of Module::Pluggable::Object - extended uri_for, added dispatcher->uri_for_action diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index f44b9db..22bb49f 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -392,7 +392,7 @@ sub register { my $priv = 0; foreach my $key ( keys %{ $action->attributes } ) { - $priv++ if $key eq 'Private'; + next if $key eq 'Private'; my $class = "Catalyst::DispatchType::$key"; unless ( $registered->{$class} ) { eval "require $class"; @@ -402,13 +402,10 @@ sub register { } # Pass the action to our dispatch types so they can register it if reqd. - my $reg = 0; foreach my $type ( @{ $self->dispatch_types } ) { - $reg++ if $type->register( $c, $action ); + $type->register( $c, $action ); } - return unless $reg + $priv; - my $namespace = $action->namespace; my $name = $action->name;