summaryrefslogtreecommitdiffstats
path: root/lib/MooseX/Role
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-07 01:07:57 -0500
committerdoy <doy@tozt.net>2008-12-07 01:07:57 -0500
commitfc8ee5015443c4316945f2994a3fdcf97546e301 (patch)
treed61b5a6d7a6f679a8c0b4d862af662adbd7fd518 /lib/MooseX/Role
parent4d86e8c87c080f2a744559fa92cd5f0894637095 (diff)
downloadmoosex-role-matcher-fc8ee5015443c4316945f2994a3fdcf97546e301.tar.gz
moosex-role-matcher-fc8ee5015443c4316945f2994a3fdcf97546e301.zip
add default match parameter in match, not in _apply_to_matches
Diffstat (limited to 'lib/MooseX/Role')
-rw-r--r--lib/MooseX/Role/Matcher.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm
index f2a01dd..7255607 100644
--- a/lib/MooseX/Role/Matcher.pm
+++ b/lib/MooseX/Role/Matcher.pm
@@ -74,7 +74,6 @@ method _apply_to_matches => sub {
my $on_match = shift;
my @list = @{ shift() };
my @matchers = @_;
- unshift @matchers, $default if (@_ % 2 == 1);
$on_match->(sub { $_->match(@matchers) }, @list);
};
@@ -159,6 +158,7 @@ method _match => sub {
method match => sub {
my $self = shift;
+ unshift @_, $default if @_ % 2 == 1;
my %args = @_;
# All the conditions must be true for true to be returned. Return