From: Simon Cozens Date: Mon, 12 Feb 2007 20:44:19 +0000 (+0000) Subject: So near and yet so far. X-Git-Tag: 1.2+svn20070808~40 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=memories.git;a=commitdiff_plain;h=4ee27d9f44c03987eaa40a9324b3f4492c3703a0 So near and yet so far. git-svn-id: http://svn.simon-cozens.org/memories/trunk@28 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- diff --git a/Tagtools.pm b/Tagtools.pm index 10a242b..371c056 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 {