summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2008-12-06 22:50:05 -0500
committerdoy <doy@tozt.net>2008-12-06 22:50:05 -0500
commit2538b5c23b461f63b26dd48019ac896a3d16b0d9 (patch)
treefff97b4311d0e54e158643cdf547f63c2cc0593b
parentba4e862f0e637237c5d4439a8798c691cade0e69 (diff)
downloadmoosex-role-matcher-2538b5c23b461f63b26dd48019ac896a3d16b0d9.tar.gz
moosex-role-matcher-2538b5c23b461f63b26dd48019ac896a3d16b0d9.zip
don't need the $matcher argument now that each is gone
-rw-r--r--lib/MooseX/Role/Matcher.pm9
1 files changed, 4 insertions, 5 deletions
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 {