You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-cvs@xml.apache.org by mr...@apache.org on 2007/07/14 19:47:43 UTC
svn commit: r556312 -
/xml/commons/trunk/java/external/src/javax/xml/datatype/Duration.java
Author: mrglavas
Date: Sat Jul 14 10:47:43 2007
New Revision: 556312
URL: http://svn.apache.org/viewvc?view=rev&rev=556312
Log:
Performance: Reducing the number of temporary strings created in toString().
Modified:
xml/commons/trunk/java/external/src/javax/xml/datatype/Duration.java
Modified: xml/commons/trunk/java/external/src/javax/xml/datatype/Duration.java
URL: http://svn.apache.org/viewvc/xml/commons/trunk/java/external/src/javax/xml/datatype/Duration.java?view=diff&rev=556312&r1=556311&r2=556312
==============================================================================
--- xml/commons/trunk/java/external/src/javax/xml/datatype/Duration.java (original)
+++ xml/commons/trunk/java/external/src/javax/xml/datatype/Duration.java Sat Jul 14 10:47:43 2007
@@ -882,17 +882,17 @@
BigInteger years = (BigInteger) getField(DatatypeConstants.YEARS);
if (years != null) {
- buf.append(years + "Y");
+ buf.append(years).append('Y');
}
BigInteger months = (BigInteger) getField(DatatypeConstants.MONTHS);
if (months != null) {
- buf.append(months + "M");
+ buf.append(months).append('M');
}
BigInteger days = (BigInteger) getField(DatatypeConstants.DAYS);
if (days != null) {
- buf.append(days + "D");
+ buf.append(days).append('D');
}
BigInteger hours = (BigInteger) getField(DatatypeConstants.HOURS);
@@ -901,13 +901,13 @@
if (hours != null || minutes != null || seconds != null) {
buf.append('T');
if (hours != null) {
- buf.append(hours + "H");
+ buf.append(hours).append('H');
}
if (minutes != null) {
- buf.append(minutes + "M");
+ buf.append(minutes).append('M');
}
if (seconds != null) {
- buf.append(toString(seconds) + "S");
+ buf.append(toString(seconds)).append('S');
}
}