luetzkendorf    2004/11/08 01:26:57

  Modified:    src/share/org/apache/slide/common UriTokenizer.java
  Log:
  small optimization using StringBuffer instead of string concatenation.
  
  Revision  Changes    Path
  1.8       +7 -8      
jakarta-slide/src/share/org/apache/slide/common/UriTokenizer.java
  
  Index: UriTokenizer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/common/UriTokenizer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- UriTokenizer.java 28 Jul 2004 09:38:08 -0000      1.7
  +++ UriTokenizer.java 8 Nov 2004 09:26:57 -0000       1.8
  @@ -63,14 +63,13 @@
           this.slideToken = slideToken;
           this.namespace = namespace;
           
  -        String courScope = new String();
  -        
           uris.addElement("/");
           
           // We parse the token list and build the scope String objects.
  +        StringBuffer b = new StringBuffer(uri.length());
           while(super.hasMoreTokens()) {
  -            courScope = courScope + "/" + super.nextToken();
  -            uris.addElement(courScope);
  +            b.append("/").append(super.nextToken());
  +            uris.addElement(b.toString());
           }
           
           pos = 0;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to