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/Xconfig/resolution_and_depth.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'perl-install/Xconfig/resolution_and_depth.pm') diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm index 1461f64be..ea859b5c7 100644 --- a/perl-install/Xconfig/resolution_and_depth.pm +++ b/perl-install/Xconfig/resolution_and_depth.pm @@ -163,7 +163,7 @@ sub choices { #- finding it in @resolutions (well @matching) #- (that way, we check it exists, and we get field "bios" for fbdev) my @default_resolutions = sort { $b->{Y} <=> $a->{Y} } grep { $_->{Depth} eq $Depth } @matching; - my $default_resolution = first(grep { $resolution_wanted->{Y} eq $_->{Y} } @default_resolutions) || $default_resolutions[0]; + my $default_resolution = (find { $resolution_wanted->{Y} eq $_->{Y} } @default_resolutions) || $default_resolutions[0]; $default_resolution, @resolutions; } @@ -243,7 +243,7 @@ sub choose_gtk { $chosen_y_res = $_[1]; } else { #- take one - my ($one) = grep { $_->{X} eq $chosen_x_res } @resolutions; + my $one = find { $_->{X} eq $chosen_x_res } @resolutions; $chosen_y_res = $one->{Y}; } my $image = $monitor_images_x_res{$chosen_x_res} or internal_error("no image for resolution $chosen_x_res"); @@ -303,9 +303,9 @@ sub choose_gtk { $x_res_combo->entry->set_text($chosen_x_res . "x" . $chosen_y_res); $W->main or return; - first(grep { $_->{X} == $chosen_x_res && - $_->{Y} == $chosen_y_res && - $_->{Depth} == $chosen_Depth } @resolutions); + find { $_->{X} == $chosen_x_res && + $_->{Y} == $chosen_y_res && + $_->{Depth} == $chosen_Depth } @resolutions); } 1; -- cgit v1.2.1