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/Bug.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Bugzilla/Bug.pm') 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); } -- cgit v1.2.3-24-g4f1b