We only need to generate the secret salt once, so initialize
it early to avoid potentially expensive `rand' ops in repeated
calls to wildmat2re. We'll also stringify it early to hopefully
improve CoW sharing and reduce fragmentation.
use Time::Local qw(timegm timelocal);
use PublicInbox::GitAsyncCat;
use PublicInbox::Address;
+my $SALT = rand . ''; # stringify early for CoW sharing
use constant {
LINE_MAX => 512, # RFC 977 section 2.3
my $tmp = $_[0] // '*';
return qr/.*/ if $tmp eq '*';
my %keep;
- my $salt = rand;
$tmp =~ s#(?<!\\)\[(.+)(?<!\\)\]#
my $orig = $1;
- my $key = sha1_hex($orig . $salt);
+ my $key = sha1_hex($orig . $SALT);
$orig =~ s/([^\w\-])+/\Q$1/g;
$keep{$key} = $orig;
$key