From: gfx Date: Sun, 19 Jul 2009 09:53:46 +0000 (+0900) Subject: Don't call an unnecessary role filter X-Git-Tag: 0.88~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8d4d1cdc0a52a13d73480e5d37cc01fb15b64aa4;p=gitmo%2FMoose.git Don't call an unnecessary role filter --- diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index fe14e95..7fe5591 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -79,7 +79,7 @@ sub ensure_all_roles { sub apply_all_roles { my $applicant = shift; - _apply_all_roles($applicant, sub { 1 }, @_); + _apply_all_roles($applicant, undef, @_); } sub _apply_all_roles { @@ -105,7 +105,9 @@ sub _apply_all_roles { } } - @$roles = grep { local $_ = $_->[0]; $role_filter->() } @$roles; + if(defined $role_filter){ + @$roles = grep { local $_ = $_->[0]; $role_filter->() } @$roles; + } return unless @$roles;