Fixed unncessary tight loop hash copy in saveindex where a pointer can be used instea...
authorJoey Hess <joey@kitenet.net>
Sat, 16 Nov 2013 16:28:01 +0000 (12:28 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 16 Nov 2013 16:28:01 +0000 (12:28 -0400)
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
debian/changelog

index 87ddb1b5643dc279a5a5ea037b9c7ce398d69ba2..9ccb92a4de41721d2adbec29bffa18f5582ac63f 100644 (file)
@@ -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};
                }
        }
 
index 92c97e947a82017d99c5a840535a8a0d6bae9f1d..fcd47494d19bc547d06033646fcb05d8fab58178 100644 (file)
@@ -2,6 +2,9 @@ ikiwiki (3.20130904.2) UNRELEASED; urgency=low
 
   * aggregate: Improve display of post author.
   * poll: Fix behavior of poll buttons when inlined.
+  * 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.
 
  -- Joey Hess <joeyh@debian.org>  Thu, 05 Sep 2013 10:01:10 -0400