put dx.pl into an explicit handle sub
[spider.git] / perl / LRU.pm
index 29fd3c87e46b048525938ab385c73f6d4f4b48b8..d86c36d55a58ea1a82b7f292f8c885330fffec68 100644 (file)
@@ -3,7 +3,7 @@
 #
 # Copyright (c) 2002 Dirk Koopman, Tobit Computer Co Ltd 
 #
-# $Id$
+#
 #
 # The structure of the objects stored are:-
 #
@@ -11,7 +11,7 @@
 #
 # The structure of the base is:-
 #
-#  [next, prev, max objects, count, <coderef to function to call on deletion> ]
+#  [next, prev, max objects, count ]
 #
 #
 
@@ -26,20 +26,13 @@ use DXDebug;
 use vars qw(@ISA);
 @ISA = qw(Chain);
 
-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));
-$main::build += $VERSION;
-$main::branch += $BRANCH;
-
 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 +80,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};