Locale.java: Reverting my last patch and add a comment why the original version was...
authorMichael Koch <konqueror@gmx.de>
Mon, 15 Mar 2004 22:04:59 +0000 (22:04 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Mon, 15 Mar 2004 22:04:59 +0000 (22:04 +0000)
2004-03-15  Michael Koch  <konqueror@gmx.de>

* java/util/Locale.java: Reverting my last patch
and add a comment why the original version was okay.

From-SVN: r79511

libjava/ChangeLog
libjava/java/util/Locale.java

index b3199d956e055723c55813cc7a9625b75365c3b3..7570a455226227504b022bbf4e6912ca3fb1b720 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-15  Michael Koch  <konqueror@gmx.de>
+
+       * java/util/Locale.java: Reverting my last patch
+       and add a comment why the original version was okay.
+
 2004-03-14  Andreas Tobler <a.tobler@schweiz.ch>
 
        * gnu/java/nio/channels/natFileChannelPosix.cc: Implement
index c77f0cb9284840c65755638a201ff5bb392f59d2..cc6d65f5f6564964e07f2f044b4df5e573cba54a 100644 (file)
@@ -436,7 +436,8 @@ public final class Locale implements Serializable, Cloneable
    */
   public String getISO3Language()
   {
-    if (language.equals(""))
+    // We know all strings are interned so we can use '==' for better performance.
+    if (language == "")
       return "";
     int index
       = ("aa,ab,af,am,ar,as,ay,az,ba,be,bg,bh,bi,bn,bo,br,ca,co,cs,cy,da,"
@@ -472,7 +473,8 @@ public final class Locale implements Serializable, Cloneable
    */
   public String getISO3Country()
   {
-    if (country.equals(""))
+    // We know all strings are interned so we can use '==' for better performance.
+    if (country == "")
       return "";
     int index
       = ("AD,AE,AF,AG,AI,AL,AM,AN,AO,AQ,AR,AS,AT,AU,AW,AZ,BA,BB,BD,BE,BF,"