mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
fix the bug in CCGraph
This commit is contained in:
parent
38f5692e21
commit
207a5725de
1 changed files with 6 additions and 6 deletions
|
|
@ -252,16 +252,16 @@ module Traverse = struct
|
||||||
bag.push (`Enter (v, []));
|
bag.push (`Enter (v, []));
|
||||||
while not (bag.is_empty ()) do
|
while not (bag.is_empty ()) do
|
||||||
match bag.pop () with
|
match bag.pop () with
|
||||||
| `Enter (x, path) ->
|
| `Enter (v, path) ->
|
||||||
if not (tags.get_tag x) then (
|
if not (tags.get_tag v) then (
|
||||||
let num = !n in
|
let num = !n in
|
||||||
incr n;
|
incr n;
|
||||||
tags.set_tag x;
|
tags.set_tag v;
|
||||||
k (`Enter (x, num, path));
|
k (`Enter (v, num, path));
|
||||||
bag.push (`Exit x);
|
bag.push (`Exit v);
|
||||||
Seq.iter
|
Seq.iter
|
||||||
(fun (e,v') -> bag.push (`Edge (v,e,v',(v,e,v') :: path)))
|
(fun (e,v') -> bag.push (`Edge (v,e,v',(v,e,v') :: path)))
|
||||||
(graph x);
|
(graph v);
|
||||||
)
|
)
|
||||||
| `Exit x -> k (`Exit x)
|
| `Exit x -> k (`Exit x)
|
||||||
| `Edge (v,e,v', path) ->
|
| `Edge (v,e,v', path) ->
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue