summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-09-12 12:09:50 +0000
committerThierry Vignaud <tv@mandriva.org>2007-09-12 12:09:50 +0000
commite2eaf07bada9cae3c70dc70974a52fe1e102e825 (patch)
treedc240a56a4af47491db47e343d8a605460fd2ca6 /perl-install
parent99e7e46f42b0a6c5890c4b0a279e2efde1ec0b3c (diff)
downloaddrakx-e2eaf07bada9cae3c70dc70974a52fe1e102e825.tar
drakx-e2eaf07bada9cae3c70dc70974a52fe1e102e825.tar.gz
drakx-e2eaf07bada9cae3c70dc70974a52fe1e102e825.tar.bz2
drakx-e2eaf07bada9cae3c70dc70974a52fe1e102e825.tar.xz
drakx-e2eaf07bada9cae3c70dc70974a52fe1e102e825.zip
(get_alternative) factorize deref
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/harddrake/sound.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm
index cf4c3fca9..ac7ff6368 100644
--- a/perl-install/harddrake/sound.pm
+++ b/perl-install/harddrake/sound.pm
@@ -192,7 +192,8 @@ sub load {
sub get_alternative {
my ($driver) = @_;
- $alsa2oss{$driver} || $oss2alsa{$driver};
+ my $list = $alsa2oss{$driver} || $oss2alsa{$driver};
+ $list ? @$list : undef;
}
sub do_switch {
@@ -225,9 +226,9 @@ sub switch {
my $driver = $device->{current_driver} || $device->{driver};
foreach (@blacklist) { $blacklisted = 1 if $driver eq $_ }
- my @alternative = $driver ne 'unknown' ? @{get_alternative($driver)} : ();
+ my @alternative = $driver ne 'unknown' ? get_alternative($driver) : ();
unless ($driver eq $device->{driver} || member($device->{driver}, @alternative)) {
- push @alternative, @{get_alternative($device->{driver})}, $device->{driver};
+ push @alternative, get_alternative($device->{driver}), $device->{driver};
}
if (@alternative) {
my $new_driver = $driver;
@@ -376,7 +377,7 @@ sub configure_sound_slots {
my $altered = 0;
each_index {
my $default_driver = $modules_conf->get_alias("sound-slot-$::i");
- if (!member($default_driver, @{get_alternative($_->{driver})}, $_->{driver})) {
+ if (!member($default_driver, get_alternative($_->{driver}), $_->{driver})) {
$altered ||= $default_driver;
configure_one_sound_slot($modules_conf, $::i, $_->{driver});
}