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/Util.pm | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'Bugzilla/Util.pm') diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index de67d5a59..03826c143 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -36,7 +36,7 @@ use base qw(Exporter); html_quote url_quote xml_quote css_class_quote html_light_quote url_decode i_am_cgi correct_urlbase remote_ip - lsearch do_ssl_redirect_if_required use_attachbase + do_ssl_redirect_if_required use_attachbase diff_arrays trim wrap_hard wrap_comment find_wrap_point format_time format_time_decimal validate_date @@ -306,18 +306,6 @@ sub use_attachbase { && $attachbase ne Bugzilla->params->{'sslbase'}) ? 1 : 0; } -sub lsearch { - my ($list,$item) = (@_); - my $count = 0; - foreach my $i (@$list) { - if ($i eq $item) { - return $count; - } - $count++; - } - return -1; -} - sub diff_arrays { my ($old_ref, $new_ref) = @_; @@ -680,9 +668,6 @@ Bugzilla::Util - Generic utility functions for bugzilla my $is_cgi = i_am_cgi(); my $urlbase = correct_urlbase(); - # Functions for searching - $loc = lsearch(\@arr, $val); - # Data manipulation ($removed, $added) = diff_arrays(\@old, \@new); @@ -821,21 +806,6 @@ otherwise. =back -=head2 Searching - -Functions for searching within a set of values. - -=over 4 - -=item C - -Returns the position of C<$item> in C<$list>. C<$list> must be a list -reference. - -If the item is not in the list, returns -1. - -=back - =head2 Data Manipulation =over 4 -- cgit v1.2.3-24-g4f1b