diff options
author | Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com> | 2013-03-07 17:53:28 -0800 |
---|---|---|
committer | Unknown <qadeer@FAIZ-AHMED-FAIZ.redmond.corp.microsoft.com> | 2013-03-07 17:53:28 -0800 |
commit | a3c14f3f4617f875306370c3a210314cd7005695 (patch) | |
tree | 3e59cb16498b587b305306442134a1bfdf684c4a /Source | |
parent | cb110795a132feec511f868e3cd53131b436c892 (diff) | |
parent | fb4518948982987d371eb7f14e4879909115e887 (diff) |
Merge
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Graph/Graph.cs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/Source/Graph/Graph.cs b/Source/Graph/Graph.cs index 4d58cbe7..ac406bb6 100644 --- a/Source/Graph/Graph.cs +++ b/Source/Graph/Graph.cs @@ -330,17 +330,9 @@ namespace Microsoft.Boogie.GraphUtil { public Node LeastCommonAncestor(Node n1, Node n2)
{
- var nums = new HashSet<int>();
int num1 = nodeToPostOrderNumber[n1], num2 = nodeToPostOrderNumber[n2];
-
- while (true)
- {
- if (!nums.Add(num1))
- return postOrderNumberToNode[num1].Val;
- if (!nums.Add(num2))
- return postOrderNumberToNode[num2].Val;
- num1 = doms[num1]; num2 = doms[num2];
- }
+ int lca = intersect(num1, num2, this.doms);
+ return postOrderNumberToNode[lca].Val;
}
}
|