From 9b0696b898ac08ba1849015b80fdb5bd0d0ae4fb Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 12 Jun 2020 01:53:25 -0700 Subject: [PATCH] Factoids: minor style clean-up --- PBot/Factoids.pm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index 340b3889..f948bf7a 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -545,7 +545,6 @@ sub make_list { $item =~ s/^\s+|\s+$//g; $item =~ s/\\\|/|/g; - if ($settings->{'uc'}) { $item = uc $item; } if ($settings->{'lc'}) { $item = lc $item; } @@ -582,7 +581,6 @@ sub make_list { sub select_item { my ($self, $context, $extracted, $modifier, %opts) = @_; - my %settings = $self->parse_expansion_modifiers($modifier); my $item; @@ -742,11 +740,9 @@ sub expand_factoid_vars { my $matches = 0; my $expansions = 0; - while ($rest =~ s/(.*?)(?select_item($context, join ('|', @list), \$rest, %opts); + return @replacements; } else { push @replacements, scalar $self->select_item($context, join ('|', @list), \$rest, %opts); } - if (wantarray) { - return @replacements; - } - my $replacement = $opts{nested} ? join('|', @replacements) : "@replacements"; if (not length $replacement) { @@ -849,9 +842,7 @@ sub expand_factoid_vars { } } - if ($matches == 0 or $expansions == 0) { - last; - } + last if $matches == 0 or $expansions == 0; if (not length $rest) { $rest = $result;