From 94f478e92798307fe2c5028afbfc7c88eee06779 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 12 Mar 2018 16:41:58 -0700 Subject: [PATCH] set field_match to be a state variable --- Debbugs/Bugs.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Debbugs/Bugs.pm b/Debbugs/Bugs.pm index 32bb390..93967e2 100644 --- a/Debbugs/Bugs.pm +++ b/Debbugs/Bugs.pm @@ -830,7 +830,7 @@ sub __handle_pkg_src_and_maint{ return grep {$packages{$_} >= $package_keys} keys %packages; } -state %field_match = ( +state $field_match = { 'subject' => \&__contains_field_match, 'tags' => sub { my ($field, $values, $status) = @_; @@ -846,14 +846,14 @@ state %field_match = ( 'originator' => \&__contains_field_match, 'forwarded' => \&__contains_field_match, 'owner' => \&__contains_field_match, -); +}; sub __bug_matches { my ($hash, $status) = @_; foreach my $key( keys( %$hash ) ) { my $value = $hash->{$key}; - next unless exists $field_match{$key}; - my $sub = $field_match{$key}; + next unless exists $field_match->{$key}; + my $sub = $field_match->{$key}; if (not defined $sub) { die "No defined subroutine for key: $key"; } -- 2.39.2