summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/xfreeX.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-07 13:22:28 +0000
commitc2f200920f04dba0874c054038770a91a71fbba5 (patch)
tree7448485cea94afcd511535b592b1f061c543f3b9 /perl-install/Xconfig/xfreeX.pm
parent0a813b0ea3c7c30ca81e79b6303f5141e95fee4b (diff)
downloaddrakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar.gz
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar.bz2
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.tar.xz
drakx-backup-do-not-use-c2f200920f04dba0874c054038770a91a71fbba5.zip
use "if any" instead of "if grep", and various other occurences of "any", "every", "partition"
Diffstat (limited to 'perl-install/Xconfig/xfreeX.pm')
-rw-r--r--perl-install/Xconfig/xfreeX.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/Xconfig/xfreeX.pm b/perl-install/Xconfig/xfreeX.pm
index 5853342f9..8351c5685 100644
--- a/perl-install/Xconfig/xfreeX.pm
+++ b/perl-install/Xconfig/xfreeX.pm
@@ -118,9 +118,8 @@ sub get_screens {
sub get_default_screen {
my ($raw_X) = @_;
my @l = get_screens($raw_X);
- my @m = grep { $_->{Identifier} && val($_->{Identifier}) eq 'screen1' ||
- $_->{Driver} && val($_->{Driver}) =~ /svga|accel/ } @l;
- first(@m ? @m : @l);
+ (find { $_->{Identifier} && val($_->{Identifier}) eq 'screen1' ||
+ $_->{Driver} && val($_->{Driver}) =~ /svga|accel/ } @l) || $l[0];
}
sub set_screens {
my ($raw_X, @screens) = @_;
@@ -172,7 +171,7 @@ sub get_resolution {
$Screen ||= $raw_X->get_default_screen or return {};
my $depth = val($Screen->{DefaultColorDepth});
- my ($Display) = grep { !$depth || val($_->{l}{Depth}) eq $depth } @{$Screen->{Display} || []} or return {};
+ my $Display = find { !$depth || val($_->{l}{Depth}) eq $depth } @{$Screen->{Display} || []} or return {};
val($Display->{l}{Modes}) =~ /(\d+)x(\d+)/ or return {};
{ X => $1, Y => $2, Depth => val($Display->{l}{Depth}) };
}