Commit ef825dc4 authored by erwan's avatar erwan
Browse files

Fix: dont crash is replay cannot answer: it can legitimally happen for directed graph

parent 06747ede
(* Time-stamp: <modified the 26/03/2019 (at 17:20) by Erwan Jahier> *)
(* Time-stamp: <modified the 27/03/2019 (at 17:28) by Erwan Jahier> *)
open Algo
open Sasacore
......@@ -17,7 +17,7 @@ let (update_env_with_init : Env.t -> Process.t list -> Algo.neighbor list list -
let (reply: Topology.t -> string -> string -> int) =
fun g source target ->
let rec f i = function
| [] -> assert false
| [] -> (-1) (* may happen in directed graphs *)
| x::t -> if x=source then i else f (i+1) t
in
f 0 (g.succ target)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment