summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config
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/Config
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/Config')
-rw-r--r--Bugzilla/Config/Common.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 7416b1794..8fc1b6037 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -144,7 +144,7 @@ sub check_utf8 {
sub check_priority {
my ($value) = (@_);
my $legal_priorities = get_legal_field_values('priority');
- if (lsearch($legal_priorities, $value) < 0) {
+ if (!grep($_ eq $value, @$legal_priorities)) {
return "Must be a legal priority value: one of " .
join(", ", @$legal_priorities);
}
@@ -154,7 +154,7 @@ sub check_priority {
sub check_severity {
my ($value) = (@_);
my $legal_severities = get_legal_field_values('bug_severity');
- if (lsearch($legal_severities, $value) < 0) {
+ if (!grep($_ eq $value, @$legal_severities)) {
return "Must be a legal severity value: one of " .
join(", ", @$legal_severities);
}
@@ -164,7 +164,7 @@ sub check_severity {
sub check_platform {
my ($value) = (@_);
my $legal_platforms = get_legal_field_values('rep_platform');
- if (lsearch(['', @$legal_platforms], $value) < 0) {
+ if (!grep($_ eq $value, '', @$legal_platforms)) {
return "Must be empty or a legal platform value: one of " .
join(", ", @$legal_platforms);
}
@@ -174,7 +174,7 @@ sub check_platform {
sub check_opsys {
my ($value) = (@_);
my $legal_OS = get_legal_field_values('op_sys');
- if (lsearch(['', @$legal_OS], $value) < 0) {
+ if (!grep($_ eq $value, '', @$legal_OS)) {
return "Must be empty or a legal operating system value: one of " .
join(", ", @$legal_OS);
}
@@ -184,7 +184,7 @@ sub check_opsys {
sub check_bug_status {
my $bug_status = shift;
my @closed_bug_statuses = map {$_->name} closed_bug_statuses();
- if (lsearch(\@closed_bug_statuses, $bug_status) < 0) {
+ if (!grep($_ eq $bug_status, @closed_bug_statuses)) {
return "Must be a valid closed status: one of " . join(', ', @closed_bug_statuses);
}
return "";