From e43cccf42dc51e144dd39ca4190221c130b2af20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 11 Mar 2009 12:59:23 +0000 Subject: [PATCH] =?utf8?q?und=20nochmal=20=C3=BCberarbeitet.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/common.pl | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 16e1b4675..aa05abab5 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -586,25 +586,22 @@ sub cross(&\@\@) { local (*A, *B) = @_; # syms for caller's input arrays # Localise $a, $b - my ($caller_a, $caller_b) = do - { + my ($caller_a, $caller_b) = do { my $pkg = caller(); no strict 'refs'; \*{$pkg.'::a'}, \*{$pkg.'::b'}; }; - my $limit = $#A > $#B? $#A : $#B; # loop iteration limit - local(*$caller_a, *$caller_b); - # This map expression is also the return value. - map { my $b_index = $_; - map { my $a_index = $_; + # This map expression is also the return value. + map { my $a_index = $_; + map { my $b_index = $_; # assign to $a, $b as refs to caller's array elements (*$caller_a, *$caller_b) = \($A[$a_index], $B[$b_index]); $op->(); # perform the transformation - } 0 .. $#A; - } 0 .. $#B; + } 0 .. $#B; + } 0 .. $#A; } 1; -- 2.20.1