From 1e100f6d178a0201aadede7420c0bc034dee7b39 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 7 Sep 2012 17:45:29 +0000 Subject: (find_installed_version) simplify since callers only care about one value --- Rpmdrake/pkg.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Rpmdrake') 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; -- cgit v1.2.1