aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-06-12 16:11:11 +0000
committerThierry Vignaud <tv@mandriva.org>2007-06-12 16:11:11 +0000
commitfe9a1edcd22047e697751b71013d323efd69bdff (patch)
tree00f521a975d38082c7d696d05bf99a41609dba9e
parenta84061ddccc993c4eb8f422361ea2b5b5166bef4 (diff)
downloadrpmdrake-fe9a1edcd22047e697751b71013d323efd69bdff.tar
rpmdrake-fe9a1edcd22047e697751b71013d323efd69bdff.tar.gz
rpmdrake-fe9a1edcd22047e697751b71013d323efd69bdff.tar.bz2
rpmdrake-fe9a1edcd22047e697751b71013d323efd69bdff.tar.xz
rpmdrake-fe9a1edcd22047e697751b71013d323efd69bdff.zip
(pkg2medium) factorize: do not call URPM::Package->id() quite a lot of time
-rwxr-xr-xRpmdrake/formatting.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/Rpmdrake/formatting.pm b/Rpmdrake/formatting.pm
index e3de5fb5..5c404b0c 100755
--- a/Rpmdrake/formatting.pm
+++ b/Rpmdrake/formatting.pm
@@ -76,8 +76,9 @@ sub urpm_name {
sub pkg2medium {
my ($p, $urpm) = @_;
+ my $id = $p->id;
foreach (@{$urpm->{media}}) {
- !$_->{ignore} && $p->id <= $_->{end} and return $_;
+ !$_->{ignore} && $id >= $_->{start} && $id <= $_->{end} and return $_;
}
undef;
}