From 2538b5c23b461f63b26dd48019ac896a3d16b0d9 Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 6 Dec 2008 22:50:05 -0500 Subject: don't need the $matcher argument now that each is gone --- lib/MooseX/Role/Matcher.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/MooseX/Role/Matcher.pm') diff --git a/lib/MooseX/Role/Matcher.pm b/lib/MooseX/Role/Matcher.pm index d614ff5..6456031 100644 --- a/lib/MooseX/Role/Matcher.pm +++ b/lib/MooseX/Role/Matcher.pm @@ -16,15 +16,14 @@ my $default = $p->default_match; method _apply_to_matches => sub { my $class = shift; my $on_match = shift; - my $matcher = shift; my @list = @{ shift() }; unshift @_, $default if (@_ % 2 == 1); - $on_match->(sub { $matcher->(@_) }, @list); + $on_match->(sub { $_->match(@_) }, @list); }; method first_match => sub { my $class = shift; - $class->_apply_to_matches(\&first, sub { $_->match(@_) }, @_); + $class->_apply_to_matches(\&first, @_); }; method each_match => sub { @@ -36,12 +35,12 @@ method each_match => sub { method grep_matches => sub { my $class = shift; my $grep = sub { my $code = shift; grep { $code->($_) } @_ }; - $class->_apply_to_matches($grep, sub { $_->match(@_) }, @_); + $class->_apply_to_matches($grep, @_); }; method any_match => sub { my $class = shift; - $class->_apply_to_matches(\&any, sub { $_->match(@_) }, @_); + $class->_apply_to_matches(\&any, @_); }; method _match => sub { -- cgit v1.2.3-54-g00ecf