mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Removed two redundant checks flagged by the compiler.
This commit is contained in:
parent
fa7e6e8363
commit
56cf847c2a
1 changed files with 25 additions and 26 deletions
|
@ -784,34 +784,34 @@ public class CPPSemantics {
|
||||||
if( inherited != null ){
|
if( inherited != null ){
|
||||||
if( result == null ){
|
if( result == null ){
|
||||||
result = inherited;
|
result = inherited;
|
||||||
} else if ( inherited != null ) {
|
} else if( !data.contentAssist ) {
|
||||||
if( !data.contentAssist ) {
|
if( result instanceof Object [] ){
|
||||||
if( result instanceof Object [] ){
|
Object [] r = (Object[]) result;
|
||||||
Object [] r = (Object[]) result;
|
for( int j = 0; j < r.length && r[j] != null; j++ ) {
|
||||||
for( int j = 0; j < r.length && r[j] != null; j++ ) {
|
if( checkForAmbiguity( data, r[j], inherited ) ){
|
||||||
if( checkForAmbiguity( data, r[j], inherited ) ){
|
data.problem = new ProblemBinding( data.astName,
|
||||||
data.problem = new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
|
IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if( checkForAmbiguity( data, result, inherited ) ){
|
|
||||||
data.problem = new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
CharArrayObjectMap temp = (CharArrayObjectMap) inherited;
|
if( checkForAmbiguity( data, result, inherited ) ){
|
||||||
CharArrayObjectMap r = (CharArrayObjectMap) result;
|
data.problem = new ProblemBinding( data.astName,
|
||||||
char[] key = null;
|
IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
|
||||||
int tempSize = temp.size();
|
return null;
|
||||||
for( int ii = 0; ii < tempSize; ii++ ){
|
}
|
||||||
key = temp.keyAt( ii );
|
}
|
||||||
if( !r.containsKey( key ) ){
|
} else {
|
||||||
r.put( key, temp.get(key) );
|
CharArrayObjectMap temp = (CharArrayObjectMap) inherited;
|
||||||
} else {
|
CharArrayObjectMap r = (CharArrayObjectMap) result;
|
||||||
//TODO: prefixLookup ambiguity checking
|
char[] key = null;
|
||||||
}
|
int tempSize = temp.size();
|
||||||
|
for( int ii = 0; ii < tempSize; ii++ ){
|
||||||
|
key = temp.keyAt( ii );
|
||||||
|
if( !r.containsKey( key ) ){
|
||||||
|
r.put( key, temp.get(key) );
|
||||||
|
} else {
|
||||||
|
//TODO: prefixLookup ambiguity checking
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2077,7 +2077,7 @@ public class CPPSemantics {
|
||||||
type = (IType) o;
|
type = (IType) o;
|
||||||
|
|
||||||
while( type != null ){
|
while( type != null ){
|
||||||
type = (type != null) ? getUltimateType( type, false ) : null;
|
type = getUltimateType( type, false );
|
||||||
if( type == null || !( type instanceof IFunctionType ) )
|
if( type == null || !( type instanceof IFunctionType ) )
|
||||||
return new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
|
return new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
|
||||||
|
|
||||||
|
@ -2450,5 +2450,4 @@ public class CPPSemantics {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue