Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
(* 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 Algo
open Sasacore open Sasacore
...@@ -17,7 +17,7 @@ let (update_env_with_init : Env.t -> Process.t list -> Algo.neighbor list list - ...@@ -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) = let (reply: Topology.t -> string -> string -> int) =
fun g source target -> fun g source target ->
let rec f i = function 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 | x::t -> if x=source then i else f (i+1) t
in in
f 0 (g.succ target) f 0 (g.succ target)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment