From d80e548735a53ddf74561e54956ddf94116608d0 Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 29 Sep 2002 00:44:08 +0000 Subject: [PATCH] try to fill the cache better --- perl/Prefix.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } } -- 2.34.1