From c2f200920f04dba0874c054038770a91a71fbba5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 7 Jan 2003 13:22:28 +0000 Subject: use "if any" instead of "if grep", and various other occurences of "any", "every", "partition" --- perl-install/standalone/drakfont | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'perl-install/standalone/drakfont') diff --git a/perl-install/standalone/drakfont b/perl-install/standalone/drakfont index 9449bc97d..959b4b055 100755 --- a/perl-install/standalone/drakfont +++ b/perl-install/standalone/drakfont @@ -243,7 +243,7 @@ sub search_windows_font { return 0; } } - !$replace && grep(/$i/, @installed_fonts) and next; + !$replace && any { /$i/ } @installed_fonts and next; grep (/$i$/, @font_list) or push @font_list, "$win_dir/$_->[1]/fonts/$i"; } @@ -285,8 +285,7 @@ sub search_dir_font { if (is_a_font($i)) { push @font_list_tmp, "$i"; foreach my $i (@font_list_tmp) { - !$replace && grep(/$i/, @installed_fonts) - and next; + !$replace && any { /$i/ } @installed_fonts and next; grep /$i/, @font_list or push @font_list, "$fn/$i"; } } @@ -294,7 +293,7 @@ sub search_dir_font { } else { if (is_a_font($fn)) { - !$replace && grep(/$fn/, @installed_fonts) and next; + !$replace && any { /$fn/ } @installed_fonts and next; !grep /$fn/, (@installed_fonts) and push @font_list, "$fn"; } } -- cgit v1.2.1