Locale.java (toString): Improve efficiency if country and variant are both empty.

2002-11-27  Julian Dolby  <dolby@us.ibm.com>

	* java/util/Locale.java (toString): Improve efficiency if country
	and variant are both empty.

From-SVN: r59590
This commit is contained in:
Julian Dolby 2002-11-27 22:41:07 +00:00 committed by Tom Tromey
parent ae5570023f
commit a828c3e105
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-11-27 Julian Dolby <dolby@us.ibm.com>
* java/util/Locale.java (toString): Improve efficiency if country
and variant are both empty.
2002-11-26 Tom Tromey <tromey@redhat.com>
* verify.cc (pop_init_ref): New method.

View File

@ -420,6 +420,8 @@ public final class Locale implements Serializable, Cloneable
{
if (language.length() == 0 && country.length() == 0)
return "";
else if (country.length() == 0 && variant.length() == 0)
return language;
StringBuffer result = new StringBuffer(language);
result.append('_').append(country);
if (variant.length() != 0)