From 894623228a8ed90aeadde862acd28613f1f54e7a Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 28 Jun 2012 20:57:29 +0000 Subject: light speedups --- URPM/Resolve.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index f79c438..f8597ba 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -107,7 +107,7 @@ sub find_candidate_packages { sub get_installed_arch { my ($db, $n) = @_; my $arch; - $db->traverse_tag('name', [ $n ], sub { $arch = $_[0]->arch }); + $db->traverse_tag_find('name', $n, sub { $arch = $_[0]->arch }); $arch; } @@ -156,7 +156,7 @@ sub is_package_installed { my ($db, $pkg) = @_; my $found; - $db->traverse_tag('name', [ $pkg->name ], sub { + $db->traverse_tag_find('name', $pkg->name, sub { my ($p) = @_; $found ||= $p->fullname eq $pkg->fullname; }); @@ -167,7 +167,7 @@ sub _is_selected_or_installed { my ($urpm, $db, $name) = @_; (grep { $_->flag_available } $urpm->packages_providing($name)) > 0 || - $db->traverse_tag('name', [ $name ], undef) > 0; + $db->traverse_tag_find('name', $name, sub {}) > 0; } #- finds $pkg "provides" that matches $provide_name, and returns the version provided -- cgit v1.2.1