projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix problem with users on multiple nodes not being propagated
[spider.git]
/
perl
/
Prefix.pm
diff --git
a/perl/Prefix.pm
b/perl/Prefix.pm
index 5733ff0254c689dabde03a16371b1f412b442d48..1e6e50c2d2e97baa42b7f8dc776b693113bf7d8f 100644
(file)
--- a/
perl/Prefix.pm
+++ b/
perl/Prefix.pm
@@
-31,9
+31,7
@@
$db = undef; # the DB_File handle
%prefix_loc = (); # the meat of the info
%pre = (); # the prefix list
$hits = $misses = $matchtotal = 1; # cache stats
%prefix_loc = (); # the meat of the info
%pre = (); # the prefix list
$hits = $misses = $matchtotal = 1; # cache stats
-$lrusize = 2000; # size of prefix LRU cache
-
-$lru = LRU->newbase('Prefix', $lrusize);
+$lrusize = 1000; # size of prefix LRU cache
sub load
{
sub load
{
@@
-43,6
+41,8
@@
sub load
untie %pre;
%pre = ();
%prefix_loc = ();
untie %pre;
%pre = ();
%prefix_loc = ();
+ $lru->close if $lru;
+ undef $lru;
}
# tie the main prefix database
}
# tie the main prefix database
@@
-50,6
+50,7
@@
sub load
my $out = $@ if $@;
do "$main::data/prefix_data.pl" if !$out;
$out = $@ if $@;
my $out = $@ if $@;
do "$main::data/prefix_data.pl" if !$out;
$out = $@ if $@;
+ $lru = LRU->newbase('Prefix', $lrusize);
return $out;
}
return $out;
}
@@
-452,7
+453,6
@@
my %valid = (
sub AUTOLOAD
{
sub AUTOLOAD
{
- my $self = shift;
no strict;
my $name = $AUTOLOAD;
no strict;
my $name = $AUTOLOAD;
@@
-463,7
+463,7
@@
sub AUTOLOAD
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
# this clever line of code creates a subroutine which takes over from autoload
# from OO Perl - Conway
*$AUTOLOAD = sub {@_ > 1 ? $_[0]->{$name} = $_[1] : $_[0]->{$name}} ;
-
&$AUTOLOAD($self, @_)
;
+
goto &$AUTOLOAD
;
}
#
}
#