cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/transformation TraxTransformer.java
Date Sat, 20 Apr 2002 00:04:17 GMT
vgritsenko    02/04/19 17:04:17

  Modified:    src/java/org/apache/cocoon/transformation
                        TraxTransformer.java
  Log:
  character iterator is slower then charAt
  
  Revision  Changes    Path
  1.23      +7 -8      xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java
  
  Index: TraxTransformer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- TraxTransformer.java	10 Apr 2002 12:55:41 -0000	1.22
  +++ TraxTransformer.java	20 Apr 2002 00:04:17 -0000	1.23
  @@ -157,7 +157,7 @@
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
    * @author <a href="mailto:marbut@hplb.hpl.hp.com">Mark H. Butler</a>
    * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  - * @version CVS $Id: TraxTransformer.java,v 1.22 2002/04/10 12:55:41 stefano Exp $
  + * @version CVS $Id: TraxTransformer.java,v 1.23 2002/04/20 00:04:17 vgritsenko Exp $
    */
   public class TraxTransformer extends AbstractTransformer
   implements Transformer, Composable, Configurable, Cacheable, Disposable {
  @@ -517,23 +517,22 @@
       // FIXME (SM): this method may be a hotspot for requests with many
       //             parameters we should try to optimize it further
       static boolean isValidXSLTParameterName(String name) {
  -        StringCharacterIterator iter = new StringCharacterIterator(name);
  -        char c = iter.first();
  +        if (name.length() == 0) {
  +            return false;
  +        }
   
  +        char c = name.charAt(0);
           if (!(Character.isLetter(c) || c == '_')) {
               return false;
  -        } else {
  -            c = iter.next();
           }
   
  -        while (c != iter.DONE) {
  +        for (int i = name.length()-1; i > 1; i--) {
  +            c = name.charAt(i);
               if (!(Character.isLetterOrDigit(c) ||
                   c == '-' ||
                   c == '_' ||
                   c == '.')) {
                   return false;
  -            } else {
  -                c = iter.next();
               }
           }
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message