Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
for is a little faster than grep
  • Loading branch information
kraih committed Feb 25, 2016
1 parent a6b7d85 commit cafe941
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -41,9 +41,7 @@ sub accepts {
return \@exts unless @_;

# Find best representation
for my $ext (@exts) {
return $ext if grep { $ext eq $_ } @_;
}
for my $ext (@exts) { $ext eq $_ and return $ext for @_ }
return @exts ? undef : shift;
}

Expand Down

0 comments on commit cafe941

Please sign in to comment.