Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

...
  • 1 commit
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 18, 2012
Alexander Bothe 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
Showing with 8 additions and 8 deletions.
  1. +8 −8 DParser2/Refactoring/TypeReferenceFinder.cs
16 DParser2/Refactoring/TypeReferenceFinder.cs
View
@@ -19,7 +19,7 @@ namespace D_Parser.Refactoring
/// </summary>
public class TypeReferenceFinder : DeepASTVisitor
{
- readonly Dictionary<IBlockNode, SortedDictionary<string, INode>> TypeCache = new Dictionary<IBlockNode, SortedDictionary<string, INode>>();
+ readonly Dictionary<IBlockNode, Dictionary<string, INode>> TypeCache = new Dictionary<IBlockNode, Dictionary<string, INode>>();
/// <summary>
/// Contains the current scope as well as the syntax region
@@ -59,7 +59,7 @@ public static TypeReferencesResult Scan(IAbstractSyntaxTree ast, ParseCacheList
void CreateDeeperLevelCache(IBlockNode bn)
{
- var dd = TypeCache[bn] = new SortedDictionary<string,INode>();
+ var dd = TypeCache[bn] = new Dictionary<string,INode>();
// Set the parent to null to crawl through current level only. Imports/Mixins etc. will be handled though.
var parentBackup = bn.Parent;
@@ -90,17 +90,14 @@ protected override void Handle(ISyntaxRegion o)
{
if (DoPrimaryIdCheck(ExtractId(o)))
result.TypeMatches.Add(o);
- return;
}
- else if (o is IdentifierExpression)
+ /*else if (o is IdentifierExpression)
{
- var id = (IdentifierExpression)o;
-
- if (DoPrimaryIdCheck((string)id.Value))
+ if (DoPrimaryIdCheck((string)((IdentifierExpression)o).Value))
q.Add(o);
}
else if (o is PostfixExpression_Access)
- q.AddRange(DoPrimaryIdCheck((PostfixExpression_Access)o));
+ q.AddRange(DoPrimaryIdCheck((PostfixExpression_Access)o));*/
}
#endregion
@@ -167,6 +164,9 @@ public static string ExtractId(ISyntaxRegion o)
#region Threaded id analysis
void ResolveAllIdentifiers()
{
+ if (q.Count == 0)
+ return;
+
if (System.Diagnostics.Debugger.IsAttached)
{
_th(sharedParseCache);

No commit comments for this range

Something went wrong with that request. Please try again.