You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by jo...@apache.org on 2014/03/22 20:30:14 UTC

svn commit: r1580292 - /thrift/cms-site/trunk/lib/view.pm

Author: joes
Date: Sat Mar 22 19:30:14 2014
New Revision: 1580292

URL: http://svn.apache.org/r1580292
Log:
testing for speed

Modified:
    thrift/cms-site/trunk/lib/view.pm

Modified: thrift/cms-site/trunk/lib/view.pm
URL: http://svn.apache.org/viewvc/thrift/cms-site/trunk/lib/view.pm?rev=1580292&r1=1580291&r2=1580292&view=diff
==============================================================================
--- thrift/cms-site/trunk/lib/view.pm (original)
+++ thrift/cms-site/trunk/lib/view.pm Sat Mar 22 19:30:14 2014
@@ -2,8 +2,20 @@ package view;
 # see https://svn.apache.org/repos/infra/websites/cms/build/lib/ASF/View.pm
 use base 'ASF::View';
 
+# included for testing purposes
+sub memoize {
+    if ($ASF::Value::Offline) {
+        # disable cache
+        my %args = @_;
+        $args{view} = [@{$args{view}}] if ref $args{view};
+        my $view = ref $args{view} ? shift @{$args{view}} : delete $args{view};
+        return view->can($view)->(%args);
+    }
+    &ASF::View::memoize;
+}
+
+# doesn't require snippets
 sub sitemap {
-    # sitemap data doesn't require snippets: be sure memoization in't enabled
     local $ASF::Value::Offline = 1;
     &ASF::View::sitemap;
 }