diff options
author | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-22 20:02:17 +0200 |
---|---|---|
committer | Max Kanat-Alexander <mkanat@bugzilla.org> | 2010-04-22 20:02:17 +0200 |
commit | 271477d8c26794abd8310e2abb89b746204660af (patch) | |
tree | a4701a52f9ff1918e25a75e09267bfba0b063296 /attachment.cgi | |
parent | 3417cb73db6d2306a012d3c624e9bec92fa1a161 (diff) | |
download | bugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.gz bugzilla-271477d8c26794abd8310e2abb89b746204660af.tar.xz |
Bug 560009: Use firstidx from List::MoreUtils instead of lsearch
r=timello, a=mkanat
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-x | attachment.cgi | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/attachment.cgi b/attachment.cgi index 0b389501b..17846866f 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -207,12 +207,10 @@ sub attachmentIsPublic { # Validates format of a diff/interdiff. Takes a list as an parameter, which # defines the valid format values. Will throw an error if the format is not # in the list. Returns either the user selected or default format. -sub validateFormat -{ +sub validateFormat { # receives a list of legal formats; first item is a default my $format = $cgi->param('format') || $_[0]; - if ( lsearch(\@_, $format) == -1) - { + if (not grep($_ eq $format, @_)) { ThrowUserError("invalid_format", { format => $format, formats => \@_ }); } |