Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
6u10
-
b77
-
x86
-
windows_vista
-
Not verified
Description
A DESCRIPTION OF THE REQUEST :
Just a slight fix for performance when doing Double.toHexString(double d) method :P
Under the method :
public static String toHexString(double d) {
It uses StringBuilder for the output however, at line 306, it's done using + syntax in a StringBuilder.
JUSTIFICATION :
Performance enchantment...
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The String buffer should be done in a new StringBuilder.append() instead of using +.
ACTUAL -
answer.append("p" + (subnormal ?
DoubleConsts.MIN_EXPONENT:
FpUtils.getExponent(d) ));
---------- BEGIN SOURCE ----------
answer.append("p" + (subnormal ?
DoubleConsts.MIN_EXPONENT:
FpUtils.getExponent(d) ));
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
answer.append("p");
answer.append((subnormal ?
DoubleConsts.MIN_EXPONENT:
FpUtils.getExponent(d) );
Just a slight fix for performance when doing Double.toHexString(double d) method :P
Under the method :
public static String toHexString(double d) {
It uses StringBuilder for the output however, at line 306, it's done using + syntax in a StringBuilder.
JUSTIFICATION :
Performance enchantment...
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The String buffer should be done in a new StringBuilder.append() instead of using +.
ACTUAL -
answer.append("p" + (subnormal ?
DoubleConsts.MIN_EXPONENT:
FpUtils.getExponent(d) ));
---------- BEGIN SOURCE ----------
answer.append("p" + (subnormal ?
DoubleConsts.MIN_EXPONENT:
FpUtils.getExponent(d) ));
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
answer.append("p");
answer.append((subnormal ?
DoubleConsts.MIN_EXPONENT:
FpUtils.getExponent(d) );