@@ -30,7 +30,7 @@ internal class DDG : PythonWalker {
3030 private SuiteStatement _curSuite ;
3131 public readonly HashSet < IPythonProjectEntry > AnalyzedEntries = new HashSet < IPythonProjectEntry > ( ) ;
3232
33- public void Analyze ( Queue < AnalysisUnit > queue , CancellationToken cancel , Action < int > reportQueueSize = null , int reportQueueInterval = 1 ) {
33+ public void Analyze ( Deque < AnalysisUnit > queue , CancellationToken cancel , Action < int > reportQueueSize = null , int reportQueueInterval = 1 ) {
3434 if ( cancel . IsCancellationRequested ) {
3535 return ;
3636 }
@@ -46,7 +46,7 @@ public void Analyze(Queue<AnalysisUnit> queue, CancellationToken cancel, Action<
4646 }
4747
4848 while ( queue . Count > 0 && ! cancel . IsCancellationRequested ) {
49- _unit = queue . Dequeue ( ) ;
49+ _unit = queue . PopLeft ( ) ;
5050
5151 if ( _unit == endOfQueueMarker ) {
5252 AnalysisLog . EndOfQueue ( queueCountAtStart , queue . Count ) ;
@@ -107,9 +107,10 @@ public InterpreterScope Scope {
107107 public PythonAnalyzer ProjectState => _unit . State ;
108108
109109 public override bool Walk ( PythonAst node ) {
110+ ModuleReference existingRef ;
110111 Debug . Assert ( node == _unit . Ast ) ;
111112
112- if ( ! ProjectState . Modules . TryImport ( _unit . DeclaringModule . Name , out var existingRef ) ) {
113+ if ( ! ProjectState . Modules . TryImport ( _unit . DeclaringModule . Name , out existingRef ) ) {
113114 // publish our module ref now so that we don't collect dependencies as we'll be fully processed
114115 if ( existingRef == null ) {
115116 ProjectState . Modules [ _unit . DeclaringModule . Name ] = new ModuleReference ( _unit . DeclaringModule , _unit . DeclaringModule . Name ) ;
@@ -470,7 +471,8 @@ internal List<AnalysisValue> LookupBaseMethods(string name, IEnumerable<IAnalysi
470471 }
471472
472473 public override bool Walk ( FunctionDefinition node ) {
473- if ( _unit . InterpreterScope . TryGetNodeScope ( node , out var funcScope ) ) {
474+ InterpreterScope funcScope ;
475+ if ( _unit . InterpreterScope . TryGetNodeScope ( node , out funcScope ) ) {
474476 var function = ( ( FunctionScope ) funcScope ) . Function ;
475477 var analysisUnit = ( FunctionAnalysisUnit ) ( ( FunctionScope ) funcScope ) . Function . AnalysisUnit ;
476478
@@ -630,7 +632,8 @@ public override bool Walk(AssertStatement node) {
630632 }
631633
632634 private void TryPushIsInstanceScope ( Node node , Expression test ) {
633- if ( Scope . TryGetNodeScope ( node , out var newScope ) ) {
635+ InterpreterScope newScope ;
636+ if ( Scope . TryGetNodeScope ( node , out newScope ) ) {
634637 var outerScope = Scope ;
635638 var isInstanceScope = ( IsInstanceScope ) newScope ;
636639
0 commit comments