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 --- attachment.cgi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'attachment.cgi') 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 => \@_ }); } -- cgit v1.2.1