xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrgla...@apache.org
Subject svn commit: r1225375 - /xalan/java/trunk/src/org/apache/xalan/templates/ElemLiteralResult.java
Date Wed, 28 Dec 2011 23:03:43 GMT
Author: mrglavas
Date: Wed Dec 28 23:03:43 2011
New Revision: 1225375

URL: http://svn.apache.org/viewvc?rev=1225375&view=rev
Log:
Minor performance improvement. String.length() == 0 tends to be slightly faster than String.equals("").

Modified:
    xalan/java/trunk/src/org/apache/xalan/templates/ElemLiteralResult.java

Modified: xalan/java/trunk/src/org/apache/xalan/templates/ElemLiteralResult.java
URL: http://svn.apache.org/viewvc/xalan/java/trunk/src/org/apache/xalan/templates/ElemLiteralResult.java?rev=1225375&r1=1225374&r2=1225375&view=diff
==============================================================================
--- xalan/java/trunk/src/org/apache/xalan/templates/ElemLiteralResult.java (original)
+++ xalan/java/trunk/src/org/apache/xalan/templates/ElemLiteralResult.java Wed Dec 28 23:03:43
2011
@@ -251,9 +251,9 @@ public class ElemLiteralResult extends E
         AVT avt = (AVT) m_avts.get(i);
         namespace = avt.getURI();
         
-        if ((namespace != null && (!namespace.equals("")) && (namespace 
+        if ((namespace != null && (namespace.length() != 0) && (namespace

                 +":"+avt.getName()).equals(name))|| ((namespace == null || 
-                namespace.equals(""))&& avt.getRawName().equals(name)))
+                namespace.length() == 0)&& avt.getRawName().equals(name)))
         {
           return avt;
         }
@@ -836,7 +836,7 @@ public class ElemLiteralResult extends E
           public String getNamespaceURI()
           {
                   String uri = m_attribute.getURI();
-                  return (uri.equals(""))?null:uri;
+                  return (uri.length() == 0)?null:uri;
           }
 
           /**
@@ -858,7 +858,7 @@ public class ElemLiteralResult extends E
           {
                   String uri = m_attribute.getURI();
                   String localName = getLocalName();
-                  return (uri.equals(""))?localName:uri+":"+localName;
+                  return (uri.length() == 0)?localName:uri+":"+localName;
           }
           
           /**
@@ -913,7 +913,7 @@ public class ElemLiteralResult extends E
           {
                   String uri = m_attribute.getURI();
                   String rawName = m_attribute.getRawName();
-                  return (uri.equals(""))? 
+                  return (uri.length() == 0)? 
                         null:rawName.substring(0, rawName.indexOf(":"));
           }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message