From b63a95340228bcd0eb70eeff5da8c3afe4e4598a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 13 Jan 2003 08:47:24 +0000 Subject: setup_local_autoscan() : simplify loop of loop and optimize away useless $alreadyfound --- perl-install/printer/printerdrake.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'perl-install') 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+)$!) { -- cgit v1.2.1