From 0cd1eda7499d9dee79656a8240447b5e40537564 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Wed, 13 Jun 2018 17:28:20 -0700 Subject: [PATCH] use state in bug_links for speed --- Debbugs/CGI.pm | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Debbugs/CGI.pm b/Debbugs/CGI.pm index a80397f..b9554ea 100644 --- a/Debbugs/CGI.pm +++ b/Debbugs/CGI.pm @@ -470,23 +470,24 @@ returning htmlized links. =cut sub bug_links { + state $spec = {bug => {type => SCALAR|ARRAYREF, + optional => 1, + }, + links_only => {type => BOOLEAN, + default => 0, + }, + class => {type => SCALAR, + default => '', + }, + separator => {type => SCALAR, + default => ', ', + }, + options => {type => HASHREF, + default => {}, + }, + }; my %param = validate_with(params => \@_, - spec => {bug => {type => SCALAR|ARRAYREF, - optional => 1, - }, - links_only => {type => BOOLEAN, - default => 0, - }, - class => {type => SCALAR, - default => '', - }, - separator => {type => SCALAR, - default => ', ', - }, - options => {type => HASHREF, - default => {}, - }, - }, + spec => $spec, ); my %options = %{$param{options}}; -- 2.39.2