diff options
author | Araq <rumpf_a@web.de> | 2019-11-21 16:06:04 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2019-11-21 16:06:04 +0100 |
commit | d45a736cc8936d57aa7cc8f73bdf5fd95799df0f (patch) | |
tree | c3ea03733d322ebfb8478df5092aa56aaf0e9d15 | |
parent | f07774d0644b9fb573fd02a6802b58eb3355c87b (diff) | |
download | Nim-d45a736cc8936d57aa7cc8f73bdf5fd95799df0f.tar.gz |
more thavlak.nim improvements
-rw-r--r-- | tests/gc/thavlak.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/gc/thavlak.nim b/tests/gc/thavlak.nim index bf238a62a..a4ef78987 100644 --- a/tests/gc/thavlak.nim +++ b/tests/gc/thavlak.nim @@ -161,7 +161,7 @@ type proc newHavlakLoopFinder(cfg: Cfg, lsg: sink Lsg): HavlakLoopFinder = result = HavlakLoopFinder(cfg: cfg, lsg: lsg) -proc isAncestor(w: int, v: int, last: seq[int]): bool = +proc isAncestor(w, v: int, last: seq[int]): bool = w <= v and v <= last[w] proc dfs(currentNode: ref BasicBlock, nodes: var seq[ref UnionFindNode], @@ -269,7 +269,7 @@ proc findLoops(self: var HavlakLoopFinder): int = # work the list... # while workList.len > 0: - var x = workList[0] + let x = workList[0] workList.del(0) # Step e: @@ -355,10 +355,10 @@ proc buildDiamond(self: var LoopTesterApp, start: int): int = newBasicBlockEdge(self.cfg, start + 2, start + 3) result = start + 3 -proc buildConnect(self: var LoopTesterApp, start1: int, end1: int) = +proc buildConnect(self: var LoopTesterApp, start1, end1: int) = newBasicBlockEdge(self.cfg, start1, end1) -proc buildStraight(self: var LoopTesterApp, start: int, n: int): int = +proc buildStraight(self: var LoopTesterApp, start, n: int): int = for i in 0..n-1: self.buildConnect(start + i, start + i + 1) result = start + n |