Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/NRefactory.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@xamarin.com>2015-12-03 12:05:24 +0300
committerMike Krüger <mkrueger@xamarin.com>2015-12-03 12:05:24 +0300
commit07ee3cddfc192daa67238811d140f7e5aa226fb9 (patch)
tree349752a63739abf2fce30584897c41e155e83d20
parent034f74e1f9639df9221ee2848d4d802bced896f1 (diff)
Fixed 'Bug 36333 - Xamarin hangs after a few seconds of usage'.
-rw-r--r--ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantAssignmentIssue.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantAssignmentIssue.cs b/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantAssignmentIssue.cs
index b1d215c5..77a6c943 100644
--- a/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantAssignmentIssue.cs
+++ b/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/RedundantAssignmentIssue.cs
@@ -433,8 +433,10 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
if (IsInsideTryOrCatchBlock(node.References [0]))
continue;
ProcessNode(node, true, nodeStates);
+ visitedNodes.Clear ();
}
}
+ HashSet<VariableReferenceNode> visitedNodes = new HashSet<Refactoring.VariableReferenceNode> ();
void ProcessNode(VariableReferenceNode node, bool addIssue,
IDictionary<VariableReferenceNode, NodeState> nodeStates)
@@ -444,6 +446,8 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
bool? reachable = false;
foreach (var nextNode in node.NextNodes) {
+ if (!visitedNodes.Add (nextNode))
+ continue;
if (nodeStates [nextNode] == NodeState.None)
ProcessNode(nextNode, false, nodeStates);