From 51294863c5d2b12805cc7a95ef46aa33bec17450 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Mon, 29 Feb 2016 12:58:40 -0500 Subject: Bug 1251047 - /rest/bug/field takes 15-25 seconds to return --- Bugzilla/User.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 1a0deed6b..04b3d32ad 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -55,7 +55,7 @@ use Bugzilla::BugUserLastVisit; use DateTime::TimeZone; use List::Util qw(max); -use List::MoreUtils qw(any); +use List::MoreUtils qw(any bsearch); use Scalar::Util qw(blessed); use Storable qw(dclone); use URI; @@ -1302,7 +1302,7 @@ sub clear_product_cache { sub can_see_product { my ($self, $product_name) = @_; - return scalar(grep {$_->name eq $product_name} @{$self->get_selectable_products}); + return bsearch { $_->name cmp $product_name } @{$self->get_selectable_products}; } sub get_selectable_products { -- cgit v1.2.3-24-g4f1b