match_glob: streamline glob cache slightly
parent
ff0e244701
commit
321bf7ec19
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue