summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.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/Util.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/Util.pm')
-rw-r--r--Bugzilla/Util.pm32
1 files changed, 1 insertions, 31 deletions
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<lsearch($list, $item)>
-
-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