aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-22 11:02:17 -0700
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-04-22 11:02:17 -0700
commit271477d8c26794abd8310e2abb89b746204660af (patch)
treea4701a52f9ff1918e25a75e09267bfba0b063296 /buglist.cgi
parentThe maintainer of MIME::tools released a new version that now supports (diff)
downloadbugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.gz
bugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.bz2
bugzilla-271477d8c26794abd8310e2abb89b746204660af.zip
Bug 560009: Use firstidx from List::MoreUtils instead of lsearch
r=timello, a=mkanat
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi14
1 files changed, 7 insertions, 7 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 3090b2a88..576b95572 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -683,7 +683,7 @@ my @selectcolumns = ("bug_id", "bug_severity", "priority", "bug_status",
"resolution", "product");
# remaining and actual_time are required for percentage_complete calculation:
-if (lsearch(\@displaycolumns, "percentage_complete") >= 0) {
+if (grep { $_ eq "percentage_complete" } @displaycolumns) {
push (@selectcolumns, "remaining_time");
push (@selectcolumns, "actual_time");
}
@@ -906,12 +906,12 @@ $buglist_sth->execute();
# of Perl records.
# If we're doing time tracking, then keep totals for all bugs.
-my $percentage_complete = lsearch(\@displaycolumns, 'percentage_complete') >= 0;
-my $estimated_time = lsearch(\@displaycolumns, 'estimated_time') >= 0;
-my $remaining_time = ((lsearch(\@displaycolumns, 'remaining_time') >= 0)
- || $percentage_complete);
-my $actual_time = ((lsearch(\@displaycolumns, 'actual_time') >= 0)
- || $percentage_complete);
+my $percentage_complete = grep($_ eq 'percentage_complete', @displaycolumns);
+my $estimated_time = grep($_ eq 'estimated_time', @displaycolumns);
+my $remaining_time = grep($_ eq 'remaining_time', @displaycolumns)
+ || $percentage_complete;
+my $actual_time = grep($_ eq 'actual_time', @displaycolumns)
+ || $percentage_complete;
my $time_info = { 'estimated_time' => 0,
'remaining_time' => 0,