mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Code streamlining.
Change-Id: Ifcf5a23c1a8948d43adc4f0761a83695bb34d3e8
This commit is contained in:
parent
4d6c9dce1a
commit
13472faa4d
1 changed files with 19 additions and 14 deletions
|
@ -422,20 +422,25 @@ public class EvalID extends CPPDependentEvaluation {
|
|||
} catch (DOMException e) {
|
||||
}
|
||||
IBinding[] bindings = data.getFoundBindings();
|
||||
if (bindings.length >= 1 && bindings[0] instanceof ICPPFunction) {
|
||||
ICPPFunction[] functions = new ICPPFunction[bindings.length];
|
||||
System.arraycopy(bindings, 0, functions, 0, bindings.length);
|
||||
return new EvalFunctionSet(new CPPFunctionSet(functions, templateArgs, null), fQualified, fAddressOf,
|
||||
impliedObjectType, getTemplateDefinition());
|
||||
}
|
||||
IBinding binding = bindings.length == 1 ? bindings[0] : null;
|
||||
if (binding instanceof IEnumerator) {
|
||||
return new EvalBinding(binding, null, getTemplateDefinition());
|
||||
} else if (binding instanceof ICPPMember) {
|
||||
return new EvalMemberAccess(nameOwner, ValueCategory.PRVALUE, binding, false, getTemplateDefinition());
|
||||
} else if (binding instanceof CPPFunctionSet) {
|
||||
return new EvalFunctionSet((CPPFunctionSet) binding, fQualified, fAddressOf, impliedObjectType,
|
||||
getTemplateDefinition());
|
||||
if (bindings.length != 0) {
|
||||
IBinding binding = bindings[0];
|
||||
if (binding instanceof ICPPFunction) {
|
||||
ICPPFunction[] functions = new ICPPFunction[bindings.length];
|
||||
System.arraycopy(bindings, 0, functions, 0, bindings.length);
|
||||
return new EvalFunctionSet(new CPPFunctionSet(functions, templateArgs, null), fQualified,
|
||||
fAddressOf, impliedObjectType, getTemplateDefinition());
|
||||
}
|
||||
if (binding instanceof CPPFunctionSet) {
|
||||
return new EvalFunctionSet((CPPFunctionSet) binding, fQualified, fAddressOf,
|
||||
impliedObjectType, getTemplateDefinition());
|
||||
}
|
||||
if (binding instanceof IEnumerator) {
|
||||
return new EvalBinding(binding, null, getTemplateDefinition());
|
||||
}
|
||||
if (binding instanceof ICPPMember) {
|
||||
return new EvalMemberAccess(nameOwner, ValueCategory.PRVALUE, binding, false,
|
||||
getTemplateDefinition());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue