From 992d4f52ff2801a48d85b65209cccc26efe8bd8c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 16 Nov 2013 12:28:01 -0400 Subject: Fixed unncessary tight loop hash copy in saveindex where a pointer can be used instead. Can speed up refreshes by nearly 50% in some circumstances. I *think* this is ok, at least it results in close to the same index being saved as before. The difference is that plugins that have a pagestate of {} have that recorded this way, while with the tight loop, the key for the plugin in not copied in that case. I cannot see how this could matter. --- IkiWiki.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'IkiWiki.pm') diff --git a/IkiWiki.pm b/IkiWiki.pm index 87ddb1b56..9ccb92a4d 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1914,11 +1914,7 @@ sub saveindex () { } if (exists $pagestate{$page}) { - foreach my $id (@plugins) { - foreach my $key (keys %{$pagestate{$page}{$id}}) { - $index{page}{$src}{state}{$id}{$key}=$pagestate{$page}{$id}{$key}; - } - } + $index{page}{$src}{state}=$pagestate{$page}; } } -- cgit v1.2.3