Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2008-03-29 17:05:58 +0000
committerSergey Prigogin2008-03-29 17:05:58 +0000
commit56cf847c2a95c25ed5fdc3569005ee48124e83d3 (patch)
treec73a49f037d2ab441cd4d1691678491712fb8662 /core/org.eclipse.cdt.core
parentfa7e6e8363866338c2a18eea076c7eb2221ac296 (diff)
downloadorg.eclipse.cdt-56cf847c2a95c25ed5fdc3569005ee48124e83d3.tar.gz
org.eclipse.cdt-56cf847c2a95c25ed5fdc3569005ee48124e83d3.tar.xz
org.eclipse.cdt-56cf847c2a95c25ed5fdc3569005ee48124e83d3.zip
Removed two redundant checks flagged by the compiler.
Diffstat (limited to 'core/org.eclipse.cdt.core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java51
1 files changed, 25 insertions, 26 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
index 51cccb5db72..82ba258800e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/CPPSemantics.java
@@ -784,34 +784,34 @@ public class CPPSemantics {
if( inherited != null ){
if( result == null ){
result = inherited;
- } else if ( inherited != null ) {
- if( !data.contentAssist ) {
- if( result instanceof Object [] ){
- Object [] r = (Object[]) result;
- for( int j = 0; j < r.length && r[j] != null; j++ ) {
- if( checkForAmbiguity( data, r[j], inherited ) ){
- data.problem = new ProblemBinding( data.astName, 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() );
+ } else if( !data.contentAssist ) {
+ if( result instanceof Object [] ){
+ Object [] r = (Object[]) result;
+ for( int j = 0; j < r.length && r[j] != null; j++ ) {
+ if( checkForAmbiguity( data, r[j], inherited ) ){
+ data.problem = new ProblemBinding( data.astName,
+ IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
return null;
}
}
} else {
- CharArrayObjectMap temp = (CharArrayObjectMap) inherited;
- CharArrayObjectMap r = (CharArrayObjectMap) result;
- 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
- }
+ if( checkForAmbiguity( data, result, inherited ) ){
+ data.problem = new ProblemBinding( data.astName,
+ IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
+ return null;
+ }
+ }
+ } else {
+ CharArrayObjectMap temp = (CharArrayObjectMap) inherited;
+ CharArrayObjectMap r = (CharArrayObjectMap) result;
+ 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;
while( type != null ){
- type = (type != null) ? getUltimateType( type, false ) : null;
+ type = getUltimateType( type, false );
if( type == null || !( type instanceof IFunctionType ) )
return new ProblemBinding( data.astName, IProblemBinding.SEMANTIC_AMBIGUOUS_LOOKUP, data.name() );
@@ -2450,5 +2450,4 @@ public class CPPSemantics {
}
return false;
}
-
}

Back to the top