3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-07 03:49:04 +02:00

Move lc out of loop (does Perl already optimize for this?)

This commit is contained in:
Pragmatic Software 2017-12-02 15:05:30 -08:00
parent 3ab8f44a8a
commit 8ac79a4cb2

View File

@ -80,8 +80,9 @@ sub exists {
my $self = shift; my $self = shift;
my ($keyword) = @_; my ($keyword) = @_;
$keyword = lc $keyword;
foreach my $ref (@{ $self->{handlers} }) { foreach my $ref (@{ $self->{handlers} }) {
return 1 if $ref->{name} eq lc $keyword; return 1 if $ref->{name} eq $keyword;
} }
return 0; return 0;
} }