summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-01-13 08:47:24 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-01-13 08:47:24 +0000
commitb63a95340228bcd0eb70eeff5da8c3afe4e4598a (patch)
treea4c83c29cadac80b1a6dc345ed783982ce8b126f
parenta9289deff78588454f1dd9471f116622bcb23b08 (diff)
downloaddrakx-b63a95340228bcd0eb70eeff5da8c3afe4e4598a.tar
drakx-b63a95340228bcd0eb70eeff5da8c3afe4e4598a.tar.gz
drakx-b63a95340228bcd0eb70eeff5da8c3afe4e4598a.tar.bz2
drakx-b63a95340228bcd0eb70eeff5da8c3afe4e4598a.tar.xz
drakx-b63a95340228bcd0eb70eeff5da8c3afe4e4598a.zip
setup_local_autoscan() : simplify loop of loop
and optimize away useless $alreadyfound
-rw-r--r--perl-install/printer/printerdrake.pm9
1 files changed, 2 insertions, 7 deletions
diff --git a/perl-install/printer/printerdrake.pm b/perl-install/printer/printerdrake.pm
index a7273d13c..04464b1bd 100644
--- a/perl-install/printer/printerdrake.pm
+++ b/perl-install/printer/printerdrake.pm
@@ -585,16 +585,11 @@ sub setup_local_autoscan {
my @port;
if ($::expert) {
@port = detect_devices::whatPrinterPort();
- foreach my $q (@port) {
+ LOOP: foreach my $q (@port) {
if (@str) {
- my $alreadyfound = 0;
foreach my $p (@autodetected) {
- if ($p->{port} eq $q) {
- $alreadyfound = 1;
- last;
- }
+ last LOOP if $p->{port} eq $q;
}
- next if $alreadyfound;
}
my $menustr;
if ($q =~ m!^/dev/lp(\d+)$!) {