From: minima Date: Sun, 29 Sep 2002 00:44:08 +0000 (+0000) Subject: try to fill the cache better X-Git-Tag: PRE-1-52~186 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d80e548735a53ddf74561e54956ddf94116608d0;p=spider.git try to fill the cache better --- diff --git a/perl/Prefix.pm b/perl/Prefix.pm index 484f462a..3fdcdcea 100644 --- a/perl/Prefix.pm +++ b/perl/Prefix.pm @@ -148,6 +148,7 @@ sub matchprefix my $pref = shift; my @partials; + $pref =~ s/-\d+$//; for (my $i = length $pref; $i; $i--) { $matchtotal++; my $s = substr($pref, 0, $i); @@ -169,7 +170,7 @@ sub matchprefix dbg("Partial prefix: $pref $s $part" ); } if (@out && $out[0] eq $s) { - $cache{$_} = [ @out ] for @partials; + $cache{$_} = \@out for @partials; return @out; } }