diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-09-07 17:45:29 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-09-07 17:45:29 +0000 |
commit | 1e100f6d178a0201aadede7420c0bc034dee7b39 (patch) | |
tree | 6ac21382737d70e239ace5f51097f034df52a258 /Rpmdrake/pkg.pm | |
parent | 8191d028adfbd8fa457662600e2e4246e51aa414 (diff) | |
download | rpmdrake-1e100f6d178a0201aadede7420c0bc034dee7b39.tar rpmdrake-1e100f6d178a0201aadede7420c0bc034dee7b39.tar.gz rpmdrake-1e100f6d178a0201aadede7420c0bc034dee7b39.tar.bz2 rpmdrake-1e100f6d178a0201aadede7420c0bc034dee7b39.tar.xz rpmdrake-1e100f6d178a0201aadede7420c0bc034dee7b39.zip |
(find_installed_version) simplify since callers only care about one value
Diffstat (limited to 'Rpmdrake/pkg.pm')
-rw-r--r-- | Rpmdrake/pkg.pm | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 0219fd67..9b76baea 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -191,12 +191,9 @@ sub extract_header { sub find_installed_version { my ($p) = @_; - my @version; - # FIXME: make it faster - # 1) reuse $db if set - # 2) s/traverse_tag/traverse_tag_find/ and time it - open_rpm_db()->traverse_tag('name', [ $p->name ], sub { push @version, version_release($_[0]) }); - @version ? join(',', sort @version) : N("(none)"); + my $version; + open_rpm_db()->traverse_tag_find('name', $p->name, sub { $version = version_release($_[0]) }); + $version || N("(none)"); } my $canceled; |