summaryrefslogtreecommitdiffstats
path: root/Bugzilla/User.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-22 20:02:17 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-22 20:02:17 +0200
commit271477d8c26794abd8310e2abb89b746204660af (patch)
treea4701a52f9ff1918e25a75e09267bfba0b063296 /Bugzilla/User.pm
parent3417cb73db6d2306a012d3c624e9bec92fa1a161 (diff)
downloadbugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.gz
bugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.xz
Bug 560009: Use firstidx from List::MoreUtils instead of lsearch
r=timello, a=mkanat
Diffstat (limited to 'Bugzilla/User.pm')
-rw-r--r--Bugzilla/User.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 5c6209811..351dddfae 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -562,10 +562,11 @@ sub get_products_by_permission {
# No need to go further if the user has no "special" privs.
return [] unless scalar(@$product_ids);
+ my %product_map = map { $_ => 1 } @$product_ids;
# We will restrict the list to products the user can see.
my $selectable_products = $self->get_selectable_products;
- my @products = grep {lsearch($product_ids, $_->id) > -1} @$selectable_products;
+ my @products = grep { $product_map{$_->id} } @$selectable_products;
return \@products;
}
@@ -1490,7 +1491,7 @@ sub is_mover {
if (!defined $self->{'is_mover'}) {
my @movers = map { trim($_) } split(',', Bugzilla->params->{'movers'});
$self->{'is_mover'} = ($self->id
- && lsearch(\@movers, $self->login) != -1);
+ && grep { $_ eq $self->login } @movers);
}
return $self->{'is_mover'};
}