velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juozas Baliuka" <bali...@mail.lt>
Subject [PATCH] optimization
Date Mon, 26 Aug 2002 17:47:14 GMT
Index: Parser.jjt
===================================================================
RCS file:
/home/cvspublic/jakarta-velocity/src/java/org/apache/velocity/runtime/parser
/Parser.jjt,v
retrieving revision 1.75
diff -u -r1.75 Parser.jjt
--- Parser.jjt 27 Apr 2002 19:32:39 -0000 1.75
+++ Parser.jjt 26 Aug 2002 17:45:35 -0000
@@ -142,7 +142,7 @@
     /**
      *  This Hashtable contains a list of all of the dynamic directives.
      */
-    private Hashtable directives = new Hashtable(0);
+    private Hashtable directives = new Hashtable(0);//Is it for "old"
java.util.* ?

     /**
      *  Name of current template we are parsing.  Passed to us in parse()
@@ -285,17 +285,19 @@

         String strDirective = strImage.substring(iLast + 1);

+        String directive = strDirective.substring(1);
+
         boolean bRecognizedDirective = false;

         /*
          *  is this a PD or a control directive?
          */

-        if ( isDirective( strDirective.substring(1)))
+        if ( isDirective( directive ))
         {
            bRecognizedDirective = true;
         }
-        else if ( rsvc.isVelocimacro( strDirective.substring(1),
currentTemplateName))
+        else if ( rsvc.isVelocimacro( directive , currentTemplateName))
         {
             bRecognizedDirective = true;
         }
@@ -303,12 +305,12 @@
         {
             /* order for speed? */

-            if ( strDirective.substring(1).equals("if")
-                || strDirective.substring(1).equals("end")
-                || strDirective.substring(1).equals("set")
-                || strDirective.substring(1).equals("else")
-                || strDirective.substring(1).equals("elseif")
-                || strDirective.substring(1).equals("stop")
+            if ( directive.equals("if")
+                || directive.equals("end")
+                || directive.equals("set")
+                || directive.equals("else")
+                || directive.equals("elseif")
+                || directive.equals("stop")
             )
             {
                 bRecognizedDirective = true;



--
To unsubscribe, e-mail:   <mailto:velocity-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-dev-help@jakarta.apache.org>


Mime
View raw message