Permalink
Browse files

use eq and ne instead of a regex

  • Loading branch information...
1 parent e64fe95 commit d41d8b640be7a0a364fefd30355081df69cc5cf0 @fcuny committed Jan 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Net/HTTP/Spore/Meta/Method/Spore.pm
View
@@ -37,14 +37,14 @@ sub find_spore_method_by_name {
sub remove_spore_method {
my ($meta, $name) = @_;
- my @methods = grep { !/$name/ } $meta->get_all_spore_methods;
+ my @methods = grep { $_ ne $name } $meta->get_all_spore_methods;
$meta->local_spore_methods(\@methods);
$meta->remove_method($name);
}
before add_spore_method => sub {
my ($meta, $name) = @_;
- if ($meta->_find_spore_method_by_name(sub {/^$name$/})) {
+ if ($meta->_find_spore_method_by_name(sub {$_ eq $name})) {
confess "method '$name' is already delcared in ".$meta->name;
}
};

0 comments on commit d41d8b6

Please sign in to comment.