summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Graph/Graph.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Graph/Graph.cs b/Source/Graph/Graph.cs
index 236baeb3..e5e8444c 100644
--- a/Source/Graph/Graph.cs
+++ b/Source/Graph/Graph.cs
@@ -99,12 +99,13 @@ namespace Graphing {
if (domineeNum == dominatorNum)
return true;
int currentNodeNum = this.doms[domineeNum];
- do {
+ while (true) {
if (currentNodeNum == dominatorNum)
return true;
+ if (currentNodeNum == this.sourceNum)
+ return false;
currentNodeNum = this.doms[currentNodeNum];
- } while (currentNodeNum != this.sourceNum);
- return false;
+ }
}
private Dictionary<Node, List<Node>> domMap = null;
[Pure]