summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Bug.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/Bug.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/Bug.pm')
-rw-r--r--Bugzilla/Bug.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 3edab563a..def8ad360 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -49,6 +49,7 @@ use Bugzilla::Group;
use Bugzilla::Status;
use Bugzilla::Comment;
+use List::MoreUtils qw(firstidx);
use List::Util qw(min first);
use Storable qw(dclone);
use URI;
@@ -3057,8 +3058,10 @@ sub editable_bug_fields {
# Obsolete custom fields are not editable.
my @obsolete_fields = Bugzilla->get_fields({obsolete => 1, custom => 1});
@obsolete_fields = map { $_->name } @obsolete_fields;
- foreach my $remove ("bug_id", "reporter", "creation_ts", "delta_ts", "lastdiffed", @obsolete_fields) {
- my $location = lsearch(\@fields, $remove);
+ foreach my $remove ("bug_id", "reporter", "creation_ts", "delta_ts",
+ "lastdiffed", @obsolete_fields)
+ {
+ my $location = firstidx { $_ eq $remove } @fields;
# Custom multi-select fields are not stored in the bugs table.
splice(@fields, $location, 1) if ($location > -1);
}