]> git.donarmstrong.com Git - debbugs.git/commitdiff
use state in bug_links for speed
authorDon Armstrong <don@donarmstrong.com>
Thu, 14 Jun 2018 00:28:20 +0000 (17:28 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 14 Jun 2018 00:28:20 +0000 (17:28 -0700)
Debbugs/CGI.pm

index a80397f4ed18524069cbd3c3137e79f964a9d41e..b9554ea651a8e67bb3e6191afda643d9f9f14ea7 100644 (file)
@@ -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}};