diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-22 11:02:17 -0700 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-22 11:02:17 -0700 |
commit | 271477d8c26794abd8310e2abb89b746204660af (patch) | |
tree | a4701a52f9ff1918e25a75e09267bfba0b063296 /Bugzilla/Bug.pm | |
parent | 3417cb73db6d2306a012d3c624e9bec92fa1a161 (diff) | |
download | bugs-271477d8c26794abd8310e2abb89b746204660af.tar bugs-271477d8c26794abd8310e2abb89b746204660af.tar.gz bugs-271477d8c26794abd8310e2abb89b746204660af.tar.bz2 bugs-271477d8c26794abd8310e2abb89b746204660af.tar.xz bugs-271477d8c26794abd8310e2abb89b746204660af.zip |
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.pm | 7 |
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); } |