[Jifty-commit] r6615 - in jifty/trunk: lib/Jifty/Web/Form

Jifty commits jifty-commit at lists.jifty.org
Tue Mar 17 10:59:36 EDT 2009


Author: alexmv
Date: Tue Mar 17 10:59:31 2009
New Revision: 6615

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web/Form/Link.pm

Log:
 r43254 at kohr-ah:  chmrr | 2009-03-17 10:40:18 -0400
 Save some method calls by caching Jifty->web


Modified: jifty/trunk/lib/Jifty/Web/Form/Link.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Link.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Link.pm	Tue Mar 17 10:59:31 2009
@@ -97,11 +97,12 @@
 sub as_string {
     my $self = shift;
     my $label = $self->label;
-    $label = Jifty->web->escape( $label )
+    my $web = Jifty->web;
+    $label = $web->escape( $label )
         if ( $self->escape_label );
 
     my $tooltip = $self->tooltip;
-    $tooltip = Jifty->web->escape( $tooltip )
+    $tooltip = $web->escape( $tooltip )
         if ( defined $tooltip and $self->escape_label );
 
     my $output = '';
@@ -113,13 +114,13 @@
     $output .= (qq( target="@{[$self->target]}")) if $self->target;
     $output .= (qq( accesskey="@{[$self->key_binding]}")) if $self->key_binding;
     $output .= (qq( rel="@{[$self->rel]}"))       if $self->rel;
-    $output .= (qq( href="@{[Jifty->web->escape($self->url)]}"));
+    $output .= (qq( href="@{[$web->escape($self->url)]}"));
     $output .= ( $self->javascript() );
     $output .= (qq(>$label</a>));
 
     $output .= (
         '<script type="text/javascript">' .
-        Jifty->web->escape($self->key_binding_javascript).
+        $web->escape($self->key_binding_javascript).
         "</script>") if $self->key_binding;
 
     return $output;


More information about the Jifty-commit mailing list