#684656 by yhahn: Prevent Views from performing an unneeded variable_set() during...
authorEarl Miles
Wed, 10 Mar 2010 20:10:07 +0000 (20:10 +0000)
committerEarl Miles
Wed, 10 Mar 2010 20:10:07 +0000 (20:10 +0000)
CHANGELOG.txt
views.module

index bf9a6f8..58ff405 100644 (file)
@@ -28,6 +28,7 @@ Views 2.x-dev
     o #674772 by joachim: Unable to distinguish profile.module fields with same name in different profile categories.
     o #727798 by SteveReher: Fix typo in overrides.html documentation.
     o #621980 by yhahn: Namespace tabs.js to guarantee no conflicts with jQuery UI.
+    o #684656 by yhahn: Prevent Views from performing an unneeded variable_set() during block list.
   
   Other changes:
     o #570558 by yhahn: Segment default views caching to conserve memory used by Views during normal operation.
index ee5e22d..002becf 100644 (file)
@@ -349,7 +349,11 @@ function views_block($op = 'list', $delta = 0, $edit = array()) {
         }
       }
 
-      variable_set('views_block_hashes', $hashes);
+      // Only save hashes if they have changed.
+      $old_hashes = variable_get('views_block_hashes', array());
+      if ($hashes != $old_hashes) {
+        variable_set('views_block_hashes', $hashes);
+      }
       // Save memory: Destroy those views.
       foreach ($views as $view) {
         $view->destroy();