aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-22 12:51:39 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-12-22 12:51:39 +0000
commitbb3c90ae7fa314898efa60048ada8bfeef35f078 (patch)
tree7abbec39c818e0bea285e38d17165392352d711a
parente47c818be52fc8efcfbe452f0c17135b153bb6bd (diff)
downloadrpmdrake-bb3c90ae7fa314898efa60048ada8bfeef35f078.tar
rpmdrake-bb3c90ae7fa314898efa60048ada8bfeef35f078.tar.gz
rpmdrake-bb3c90ae7fa314898efa60048ada8bfeef35f078.tar.bz2
rpmdrake-bb3c90ae7fa314898efa60048ada8bfeef35f078.tar.xz
rpmdrake-bb3c90ae7fa314898efa60048ada8bfeef35f078.zip
Optimize pkg2medium function, by Ian D. Allen (bug #12769)
-rwxr-xr-xrpmdrake7
1 files changed, 4 insertions, 3 deletions
diff --git a/rpmdrake b/rpmdrake
index b7309d58..68ef4817 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -318,9 +318,10 @@ sub parse_compssUsers_flat {
sub pkg2medium {
my ($p, $urpm) = @_;
- my $tmp;
- each_index { !$_->{ignore} && $p->id <= $_->{end} and $tmp ||= ${$urpm->{media}}[$::i] } @{$urpm->{media}};
- $tmp;
+ foreach ( @{$urpm->{media}} ) {
+ !$_->{ignore} && $p->id <= $_->{end} and return $_;
+ }
+ undef;
}
#- strftime returns a string in the locale charset encoding;