Conversions: now it's in a list of values; we can use List::Util again!

master
Rob Emery 2016-05-09 20:34:15 +01:00
parent 13509c09b1
commit bdd54b6a8f
1 changed files with 2 additions and 7 deletions

View File

@ -8,6 +8,7 @@ with 'DDG::GoodieRole::NumberStyler';
use Math::Round qw/nearest/;
use utf8;
use YAML::XS 'LoadFile';
use List::Util qw(any);
zci answer_type => 'conversions';
zci is_cached => 1;
@ -191,13 +192,7 @@ handle query_lc => sub {
sub looks_plural {
my ($input) = @_;
my $is_plural = 0;
foreach my $x (values(%plurals)) {
$is_plural = 1 if(lc($x) eq lc($input));
}
return $is_plural;
return any {lc($_) eq lc($input)} values(%plurals);
}
sub convert_temperatures {