Skip to content

Commit

Permalink
use less code for AUTOLOAD
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 23, 2015
1 parent 77f75b0 commit 2076669
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Mojolicious/Validator/Validation.pm
Expand Up @@ -14,9 +14,8 @@ sub AUTOLOAD {
Carp::croak "Undefined subroutine &${package}::$method called"
unless Scalar::Util::blessed $self && $self->isa(__PACKAGE__);

Carp::croak qq{Can't locate object method "$method" via package "$package"}
unless $self->validator->checks->{$method};
return $self->check($method => @_);
return $self->check($method => @_) if $self->validator->checks->{$method};
Carp::croak qq{Can't locate object method "$method" via package "$package"};
}

sub check {
Expand Down

0 comments on commit 2076669

Please sign in to comment.