Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Performance improvement for scalar constants: accessing one is now 5 …

…times faster!
  • Loading branch information...
commit 42ad225b771f025f4add62a9170b819f496bfd8a 1 parent 7f3d7a3
@neilbowers authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/Constant/Generate.pm
View
3  lib/Constant/Generate.pm
@@ -71,7 +71,8 @@ sub _gen_constant {
no strict 'refs';
my $fqname = $pkg . "::$name";
if(@values == 1) {
- *{$fqname} = sub () { $values[0] };
+ my $value = $values[0];
+ *{$fqname} = sub () { $value };
} else {
*{$fqname} = sub () { @values };
}
Please sign in to comment.
Something went wrong with that request. Please try again.