1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 16:05:25 +02:00

Code streamlining.

This commit is contained in:
Sergey Prigogin 2016-02-04 10:59:29 -08:00
parent 6f359aba30
commit ed8a6ea120
2 changed files with 24 additions and 27 deletions

View file

@ -630,7 +630,7 @@ public class TemplateArgumentDeduction {
private static ICPPClassType findBaseInstance(ICPPClassType a, ICPPClassTemplate pTemplate, int maxdepth, HashSet<Object> handled, IASTNode point) throws DOMException { private static ICPPClassType findBaseInstance(ICPPClassType a, ICPPClassTemplate pTemplate, int maxdepth, HashSet<Object> handled, IASTNode point) throws DOMException {
if (a instanceof ICPPTemplateInstance) { if (a instanceof ICPPTemplateInstance) {
final ICPPTemplateInstance inst = (ICPPTemplateInstance) a; ICPPTemplateInstance inst = (ICPPTemplateInstance) a;
ICPPClassTemplate tmpl= getPrimaryTemplate(inst); ICPPClassTemplate tmpl= getPrimaryTemplate(inst);
if (pTemplate.isSameType(tmpl)) if (pTemplate.isSameType(tmpl))
return a; return a;

View file

@ -505,7 +505,7 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
getPDOM().putCachedResult(inputBinding, pdomBinding); getPDOM().putCachedResult(inputBinding, pdomBinding);
} }
if (shouldUpdate(pdomBinding, fromName)) { if (fromName != null && shouldUpdate(pdomBinding, fromName)) {
IBinding fromBinding = fromName.getBinding(); IBinding fromBinding = fromName.getBinding();
pdomBinding.update(this, fromBinding, null); pdomBinding.update(this, fromBinding, null);
@ -520,7 +520,6 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
} }
private boolean shouldUpdate(PDOMBinding pdomBinding, IASTName fromName) throws CoreException { private boolean shouldUpdate(PDOMBinding pdomBinding, IASTName fromName) throws CoreException {
if (fromName != null) {
if (pdomBinding instanceof IParameter || pdomBinding instanceof ICPPTemplateParameter) if (pdomBinding instanceof IParameter || pdomBinding instanceof ICPPTemplateParameter)
return false; return false;
if (fromName.isReference()) { if (fromName.isReference()) {
@ -545,8 +544,6 @@ class PDOMCPPLinkage extends PDOMLinkage implements IIndexCPPBindingConstants {
} }
return !getPDOM().hasLastingDefinition(pdomBinding); return !getPDOM().hasLastingDefinition(pdomBinding);
} }
return false;
}
PDOMBinding createBinding(PDOMNode parent, IBinding binding, long fileLocalRec, IASTNode point) PDOMBinding createBinding(PDOMNode parent, IBinding binding, long fileLocalRec, IASTNode point)
throws CoreException, DOMException { throws CoreException, DOMException {