Skip to content

Commit

Permalink
using the grep method is not slower anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jun 29, 2017
1 parent 925b3c8 commit 6c0d311
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/Mojo/DOM.pm
Expand Up @@ -282,11 +282,7 @@ sub _replace {
return $self->parent;
}

sub _select {
my ($collection, $selector) = @_;
return $collection unless $selector;
return $collection->new(grep { $_->matches($selector) } @$collection);
}
sub _select { $_[1] ? $_[0]->grep(matches => $_[1]) : $_[0] }

sub _siblings {
my ($self, $tags) = @_;
Expand Down

0 comments on commit 6c0d311

Please sign in to comment.