velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: [PATCH] optimization
Date Mon, 26 Aug 2002 17:53:34 GMT
On 8/26/02 1:47 PM, "Juozas Baliuka" <baliuka@mail.lt> wrote:

> 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>
> 


Good one.  Thx

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
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