diff options
author | Julian Dolby <dolby@us.ibm.com> | 2002-11-27 22:41:07 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-11-27 22:41:07 +0000 |
commit | a828c3e10560daeda5feec685c1c494bca90d120 (patch) | |
tree | ac097deb43305ca94aa86867cc2144ab95a3f03b /libjava | |
parent | ae5570023f682b92235b7046ba693622686aceae (diff) | |
download | gcc-a828c3e10560daeda5feec685c1c494bca90d120.zip gcc-a828c3e10560daeda5feec685c1c494bca90d120.tar.gz gcc-a828c3e10560daeda5feec685c1c494bca90d120.tar.bz2 |
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
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/java/util/Locale.java | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f8beb18..7bdb8eb 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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. diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java index df5dac1..22e1938 100644 --- a/libjava/java/util/Locale.java +++ b/libjava/java/util/Locale.java @@ -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) |