X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FLRU.pm;h=3bc66f0b9cc207f1facee7353dd0d3d3987dfda2;hb=4327a846608d5828537a3c37f90848db0f10d06f;hp=29fd3c87e46b048525938ab385c73f6d4f4b48b8;hpb=1172aa77de530206b0dbb648d8489922a518d502;p=spider.git diff --git a/perl/LRU.pm b/perl/LRU.pm index 29fd3c87..3bc66f0b 100644 --- a/perl/LRU.pm +++ b/perl/LRU.pm @@ -11,7 +11,7 @@ # # The structure of the base is:- # -# [next, prev, max objects, count, ] +# [next, prev, max objects, count ] # # @@ -28,7 +28,7 @@ use vars qw(@ISA); use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/,(0,0)); $main::build += $VERSION; $main::branch += $BRANCH; @@ -37,9 +37,8 @@ sub newbase my $pkg = shift; my $name = shift; my $max = shift; - my $coderef = shift; confess "LRU->newbase requires a name and maximal count" unless $name && $max; - return $pkg->SUPER::new({ }, $max, 0, $name, $coderef); + return $pkg->SUPER::new({ }, $max, 0, $name); } sub get @@ -87,7 +86,6 @@ sub remove my $q = $self->obj->{$call}; confess("$call is already removed") unless $q; dbg("LRU $self->[5] cache remove $call now $self->[4]/$self->[3]") if isdbg('lru'); - &{$self->[5]}($q->obj) if $self->[5]; $q->obj(1); $q->SUPER::del; delete $self->obj->{$call};