Skip to content
This repository
  • 1 commit
  • 1 file changed
  • 0 comments
  • 1 contributor
Aug 18, 2012
Finally, fuck long identifier resolution times. Disabled enlisting of…
… any type expressions to reduce computation time by ~99.99% - the results are still acceptable
63434ad
16  DParser2/Refactoring/TypeReferenceFinder.cs
@@ -19,7 +19,7 @@ namespace D_Parser.Refactoring
19 19
 	/// </summary>
20 20
 	public class TypeReferenceFinder : DeepASTVisitor
21 21
 	{
22  
-		readonly Dictionary<IBlockNode, SortedDictionary<string, INode>> TypeCache = new Dictionary<IBlockNode, SortedDictionary<string, INode>>();
  22
+		readonly Dictionary<IBlockNode, Dictionary<string, INode>> TypeCache = new Dictionary<IBlockNode, Dictionary<string, INode>>();
23 23
 
24 24
 		/// <summary>
25 25
 		/// Contains the current scope as well as the syntax region
@@ -59,7 +59,7 @@ public static TypeReferencesResult Scan(IAbstractSyntaxTree ast, ParseCacheList
59 59
 
60 60
 		void CreateDeeperLevelCache(IBlockNode bn)
61 61
 		{
62  
-			var dd = TypeCache[bn] = new SortedDictionary<string,INode>();
  62
+			var dd = TypeCache[bn] = new Dictionary<string,INode>();
63 63
 
64 64
 			// Set the parent to null to crawl through current level only. Imports/Mixins etc. will be handled though.
65 65
 			var parentBackup = bn.Parent;
@@ -90,17 +90,14 @@ protected override void Handle(ISyntaxRegion o)
90 90
 			{
91 91
 				if (DoPrimaryIdCheck(ExtractId(o)))
92 92
 					result.TypeMatches.Add(o);
93  
-				return;
94 93
 			}
95  
-			else if (o is IdentifierExpression)
  94
+			/*else if (o is IdentifierExpression)
96 95
 			{
97  
-				var id = (IdentifierExpression)o;
98  
-
99  
-				if (DoPrimaryIdCheck((string)id.Value))
  96
+				if (DoPrimaryIdCheck((string)((IdentifierExpression)o).Value))
100 97
 					q.Add(o);
101 98
 			}
102 99
 			else if (o is PostfixExpression_Access)
103  
-				q.AddRange(DoPrimaryIdCheck((PostfixExpression_Access)o));
  100
+				q.AddRange(DoPrimaryIdCheck((PostfixExpression_Access)o));*/
104 101
 		}
105 102
 		#endregion
106 103
 
@@ -167,6 +164,9 @@ public static string ExtractId(ISyntaxRegion o)
167 164
 		#region Threaded id analysis
168 165
 		void ResolveAllIdentifiers()
169 166
 		{
  167
+			if (q.Count == 0)
  168
+				return;
  169
+
170 170
 			if (System.Diagnostics.Debugger.IsAttached)
171 171
 			{
172 172
 				_th(sharedParseCache);

No commit comments for this range

Something went wrong with that request. Please try again.