[Jifty-commit] r6055 - Template-Declare/lib/Template

Jifty commits jifty-commit at lists.jifty.org
Mon Dec 1 04:17:16 EST 2008


Author: ruz
Date: Mon Dec  1 04:17:14 2008
New Revision: 6055

Modified:
   Template-Declare/lib/Template/Declare.pm

Log:
* safe a call and array ref access by using local variable

Modified: Template-Declare/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/lib/Template/Declare.pm	(original)
+++ Template-Declare/lib/Template/Declare.pm	Mon Dec  1 04:17:14 2008
@@ -361,10 +361,10 @@
 }
 
 sub buffer {
-    unless ( __PACKAGE__->buffer_stack->[0] ) {
-        Carp::confess( __PACKAGE__ . "->buffer called with no buffer" );
-    }
-    return __PACKAGE__->buffer_stack->[0];
+    my $res = __PACKAGE__->buffer_stack->[0];
+    Carp::confess( __PACKAGE__ . "->buffer called with no buffer" )
+        unless $res;
+    return $res;
 }
 
 =head2 show TEMPLATE_NAME


More information about the Jifty-commit mailing list