From 74a568a4c57b8d8af0926448bf793fc13d4fa1dc Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Mon, 15 Mar 2004 22:04:59 +0000 Subject: Locale.java: Reverting my last patch and add a comment why the original version was okay. 2004-03-15 Michael Koch * java/util/Locale.java: Reverting my last patch and add a comment why the original version was okay. From-SVN: r79511 --- libjava/java/util/Locale.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libjava/java/util/Locale.java') diff --git a/libjava/java/util/Locale.java b/libjava/java/util/Locale.java index c77f0cb..cc6d65f 100644 --- a/libjava/java/util/Locale.java +++ b/libjava/java/util/Locale.java @@ -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," -- cgit v1.1