summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.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/Template.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/Template.pm')
-rw-r--r--Bugzilla/Template.pm6
1 files changed, 5 insertions, 1 deletions
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