From 271477d8c26794abd8310e2abb89b746204660af Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Thu, 22 Apr 2010 11:02:17 -0700 Subject: Bug 560009: Use firstidx from List::MoreUtils instead of lsearch r=timello, a=mkanat --- Bugzilla/Template.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Template.pm') diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index da46774a1..a4e250cfc 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -55,6 +55,7 @@ use File::Find; use File::Path qw(rmtree mkpath); use File::Spec; use IO::Dir; +use List::MoreUtils qw(firstidx); use Scalar::Util qw(blessed); use base qw(Template); @@ -716,7 +717,10 @@ sub create { 'time2str' => \&Date::Format::time2str, # Generic linear search function - 'lsearch' => \&Bugzilla::Util::lsearch, + 'lsearch' => sub { + my ($array, $item) = @_; + return firstidx { $_ eq $item } @$array; + }, # Currently logged in user, if any # If an sudo session is in progress, this is the user we're faking -- cgit v1.2.3-24-g4f1b