XmlName.equals: simplify, take 2
authorYann Cébron <yann.cebron@jetbrains.com>
Tue, 28 Jun 2016 09:46:29 +0000 (11:46 +0200)
committerYann Cébron <yann.cebron@jetbrains.com>
Tue, 28 Jun 2016 09:46:29 +0000 (11:46 +0200)
xml/dom-openapi/src/com/intellij/util/xml/XmlName.java

index ec528256e7fdb453a490a7c84e248c2d1d8974ae..b730d05b5b38c8a539c4cf52cea559ed2d207009 100644 (file)
@@ -57,11 +57,7 @@ public class XmlName implements Comparable<XmlName> {
     final XmlName xmlName = (XmlName)o;
 
     if (!myLocalName.equals(xmlName.myLocalName)) return false;
-    if (Comparing.equal(myNamespaceKey, xmlName.myNamespaceKey)) return true;
-
-    if (myNamespaceKey == null) return false;
-
-    return myNamespaceKey.equals(xmlName.myNamespaceKey);
+    return Comparing.equal(myNamespaceKey, xmlName.myNamespaceKey);
   }
 
   public int hashCode() {