diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-11-17 00:01:08 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-11-17 00:04:01 +0400 |
commit | 1dec7b308b82dccee46cfac9e6fbbc3df91a03b4 (patch) | |
tree | c5bdc9ae2ff8f685a7cedcb567bc69f0bfa682ad /main/src/addins/CSharpBinding | |
parent | c23618702c200c53c026ce73ef47d534478c8886 (diff) |
[CSharpbinding] Made namespace usage inpector faster.
Diffstat (limited to 'main/src/addins/CSharpBinding')
-rw-r--r-- | main/src/addins/CSharpBinding/MonoDevelop.CSharp.Inspection/Inspectors/RedundantNamespaceUsageInspector.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Inspection/Inspectors/RedundantNamespaceUsageInspector.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Inspection/Inspectors/RedundantNamespaceUsageInspector.cs index 1923dec55e..55a2c8bfee 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Inspection/Inspectors/RedundantNamespaceUsageInspector.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Inspection/Inspectors/RedundantNamespaceUsageInspector.cs @@ -37,12 +37,14 @@ namespace MonoDevelop.CSharp.Inspection protected override void Attach (ObservableAstVisitor<InspectionData, object> visitor) { visitor.MemberReferenceExpressionVisited += delegate (MemberReferenceExpression mr, InspectionData data) { - var state = data.GetResolverStateBefore (mr); - var wholeResult = data.GetResolveResult (mr); var result = data.GetResolveResult (mr.Target); - if (!(result is NamespaceResolveResult) || !(wholeResult is TypeResolveResult)) + if (!(result is NamespaceResolveResult)) + return; + var wholeResult = data.GetResolveResult (mr); + if (!(wholeResult is TypeResolveResult)) return; + var state = data.GetResolverStateBefore (mr); var lookupName = state.LookupSimpleNameOrTypeName (mr.MemberName, new List<IType> (), SimpleNameLookupMode.Expression); if (lookupName != null && wholeResult.Type.Equals (lookupName.Type)) { |