projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1172aa7
)
restore LRU
author
minima
<minima>
Wed, 12 Mar 2003 13:49:39 +0000
(13:49 +0000)
committer
minima
<minima>
Wed, 12 Mar 2003 13:49:39 +0000
(13:49 +0000)
perl/LRU.pm
patch
|
blob
|
history
diff --git
a/perl/LRU.pm
b/perl/LRU.pm
index 29fd3c87e46b048525938ab385c73f6d4f4b48b8..30b264a525c1ec4afb17d4705d91f8e90ca136de 100644
(file)
--- a/
perl/LRU.pm
+++ b/
perl/LRU.pm
@@
-11,7
+11,7
@@
#
# The structure of the base is:-
#
#
# The structure of the base is:-
#
-# [next, prev, max objects, count
, <coderef to function to call on deletion>
]
+# [next, prev, max objects, count ]
#
#
#
#
@@
-37,9
+37,8
@@
sub newbase
my $pkg = shift;
my $name = shift;
my $max = shift;
my $pkg = shift;
my $name = shift;
my $max = shift;
- my $coderef = shift;
confess "LRU->newbase requires a name and maximal count" unless $name && $max;
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
}
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');
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};
$q->obj(1);
$q->SUPER::del;
delete $self->obj->{$call};