svn commit: r566226 - /lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/Link.java

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: andreas
Date: Wed Aug 15 08:43:11 2007
New Revision: 566226

URL: http://svn.apache.org/viewvc?view=rev&rev=566226
Log:
Use StringTokenizer instead of String.split() for performance reasons

Modified:
    lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/Link.java

Modified: lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/Link.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/Link.java?view=diff&rev=566226&r1=566225&r2=566226
==============================================================================
--- lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/Link.java (original)
+++ lenya/trunk/src/modules-core/linking/java/src/org/apache/lenya/cms/linking/Link.java Wed Aug 15 08:43:11 2007
@@ -18,6 +18,7 @@
 package org.apache.lenya.cms.linking;
 
 import java.net.MalformedURLException;
+import java.util.StringTokenizer;
 
 import org.apache.lenya.util.Query;
 
@@ -52,8 +53,9 @@
             throw new MalformedURLException("The string [" + linkUri + "] is not a valid link URI!");
         }
         
-        String[] schemeAndPath = linkUri.split(":");
-        String path = schemeAndPath[1];
+        StringTokenizer schemeAndPath = new StringTokenizer(linkUri, ":");
+        schemeAndPath.nextToken();
+        String path = schemeAndPath.nextToken();
 
         if (path.indexOf(PAIR_DELIMITER) > -1) {
             int firstDelimiterIndex = path.indexOf(PAIR_DELIMITER);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.