Joseph N. Hall [Fri, 5 Sep 1997 00:00:00 +0000 (00:00 +0000)]
Give this a try. It causes unsuccessful searches to run about
3 times as fast on my machine. Not exactly a speed demon but
at least you don't have time to get up and make coffee.
I tried adding caching to stop the repeated readdir in the
case-insensitive matching subroutine, but a) it only lopped off
another 20% and b) the patch made a kind of a Frankenstein thing
out of the subroutine, so c) I will try to write a better one
later when I have time.
p5p-msgid: MailDrop1.2d7dPPC.
971012211957@screechy.cscaper.com
if($recurse) {
opendir(D,$dir);
- my(@newdirs) = grep(-d,map("$dir/$_",grep(!/^\.\.?$/,readdir(D))));
+ my @newdirs = map "$dir/$_", grep {
+ not /^\.\.?$/ and
+ not /^auto$/ and # save time! don't search auto dirs
+ -d "$dir/$_"
+ } readdir D;
closedir(D);
@newdirs = map((s/.dir$//,$_)[1],@newdirs) if $Is_VMS;
next unless @newdirs;