1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

So _that's_ why mkfiles.pl was running so slowly on my Windows box!

&findfile() now caches its results. At least one full order of
magnitude speedup when running on an SMB-mounted volume. Phew.

[originally from svn r3720]
This commit is contained in:
Simon Tatham 2004-01-17 13:24:59 +00:00
parent 276c8335af
commit b601727068

View File

@ -184,12 +184,15 @@ foreach $i (keys %depends) {
sub findfile {
my ($name) = @_;
my $dir, $i, $outdir = "";
$i = 0;
foreach $dir (@incdirs) {
$outdir = $dir, $i++ if -f "$dir$name";
unless (defined $findfilecache{$name}) {
$i = 0;
foreach $dir (@incdirs) {
$outdir = $dir, $i++ if -f "$dir$name";
}
die "multiple instances of source file $name\n" if $i > 1;
$findfilecache{$name} = $outdir . $name;
}
die "multiple instances of source file $name\n" if $i > 1;
return "$outdir$name";
return $findfilecache{$name};
}
sub objects {