From c4f41223439d9c7626a3ae0edabdf158af9fdad6 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Thu, 28 Jul 2016 10:03:03 -0700 Subject: [PATCH] Minor optimization in TypeInstantiationRequest.equals method. Change-Id: Ie9efe4000b9354e9c2193a0f8264e771ffe8e169 --- .../dom/parser/cpp/semantics/TypeInstantiationRequest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java index bedee4d8286..dd8ac37801f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/TypeInstantiationRequest.java @@ -59,7 +59,9 @@ public class TypeInstantiationRequest { @Override public boolean equals(Object obj) { - if (!obj.getClass().equals(getClass())) + if (this == obj) + return true; + if (!getClass().equals(obj.getClass())) return false; TypeInstantiationRequest other = (TypeInstantiationRequest) obj; if (!type.isSameType(other.type))