X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=Tagtools.pm;h=f161c475b4e9bcf9edd4090cfe1ffbfd697d0078;hb=2fbbd5523381d92d751d9930ccd2993449a508da;hp=10a242be8da1b317d7f7d43cf5ef4768988f922d;hpb=7767c51977a235b2f9205da1a94b07ba55ad2f52;p=memories.git diff --git a/Tagtools.pm b/Tagtools.pm index 10a242b..f161c47 100644 --- a/Tagtools.pm +++ b/Tagtools.pm @@ -18,9 +18,9 @@ sub import { *{$whence."::do_cached"} = sub { my ($self, $codeblock,$arg) = @_; my $key = 0+$codeblock; if ($arg) { $key .=":".encode_base64(freeze(\$arg)); } - my $c = $cache->get(0+$codeblock); return @$c if $c; + my $c = $cache->get($key); return @$c if $c; my @stuff = $codeblock->($arg); - $cache->set(0+$codeblock, [ @stuff ]); + $cache->set($key, [ @stuff ]); return @stuff; }; *{$whence."::_tagcloud"} = sub { @@ -33,7 +33,6 @@ sub import { $cloud }; *{$whence."::_calendar"} = sub { - my $self = shift; my $arg = shift; my ($y, $m) = split /-/, ($arg || Time::Piece->new->ymd); my @m = Calendar::Simple::calendar($m, $y);