match_glob: streamline glob cache slightly

master
Simon McVittie 2010-11-17 20:04:55 +00:00
parent ff0e244701
commit 321bf7ec19
1 changed files with 1 additions and 2 deletions

View File

@ -2493,8 +2493,7 @@ sub match_glob ($$;@) {
# Instead of converting the glob to a regex every time, # Instead of converting the glob to a regex every time,
# cache the compiled regex to save time. # cache the compiled regex to save time.
if (!exists $glob_cache{$glob} if (!defined $glob_cache{$glob}) {
or !defined $glob_cache{$glob}) {
my $re = IkiWiki::glob2re($glob); my $re = IkiWiki::glob2re($glob);
$glob_cache{$glob} = qr/^$re$/i; $glob_cache{$glob} = qr/^$re$/i;
} }