Skip to content

Commit

Permalink
Minor performance improvement. Use the char version of StringBuffer.a…
Browse files Browse the repository at this point in the history
…ppend() and String.indexOf().

git-svn-id: https://svn.apache.org/repos/asf/xalan/java/trunk@1225761 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Michael Glavassevich committed Dec 30, 2011
1 parent a697b32 commit 5b396a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/org/apache/xalan/lib/ExsltDatetime.java
Expand Up @@ -87,7 +87,7 @@ public static String dateTime()
// If there is no offset, we have "Coordinated
// Universal Time."
if (offset == 0)
buff.append("Z");
buff.append('Z');
else
{
// Convert milliseconds to hours and minutes
Expand Down Expand Up @@ -818,7 +818,7 @@ else if (z == -2)
*/
private static int getZoneStart (String datetime)
{
if (datetime.indexOf("Z") == datetime.length()-1)
if (datetime.indexOf('Z') == datetime.length()-1)
return datetime.length()-1;
else if (datetime.length() >=6
&& datetime.charAt(datetime.length()-3) == ':'
Expand Down Expand Up @@ -1083,7 +1083,6 @@ else if ((dateTime.length() >= 6)
*/
private static String strip(String symbols, String pattern)
{
int quoteSemaphore = 0;
int i = 0;
StringBuffer result = new StringBuffer(pattern.length());

Expand All @@ -1092,7 +1091,7 @@ private static String strip(String symbols, String pattern)
char ch = pattern.charAt(i);
if (ch == '\'')
{
// Assume it's an openening quote so simply copy the quoted
// Assume it's an opening quote so simply copy the quoted
// text to the result. There is nothing to strip here.
int endQuote = pattern.indexOf('\'', i + 1);
if (endQuote == -1)
Expand Down

0 comments on commit 5b396a6

Please sign in to comment.