From fc8ee5015443c4316945f2994a3fdcf97546e301 Mon Sep 17 00:00:00 2001 From: doy Date: Sun, 7 Dec 2008 01:07:57 -0500 Subject: add default match parameter in match, not in _apply_to_matches --- lib/MooseX/Role/Matcher.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/MooseX/Role') 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 -- cgit v1.2.3-54-g00ecf