From 4ad08c8c03d6eb1bbdd8d9ba4068c65c945c98f7 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 2 Jun 2020 00:19:45 +0200 Subject: [PATCH] Order blocks by block_id --- ocaml/Random_variable.ml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ocaml/Random_variable.ml b/ocaml/Random_variable.ml index b19796c..0e9fafb 100644 --- a/ocaml/Random_variable.ml +++ b/ocaml/Random_variable.ml @@ -94,6 +94,12 @@ let of_raw_data ?(locked=true) ~range property = let data = Block.raw_data ~locked () |> List.filter (fun x -> x.Block.property = property) + |> List.sort (fun x y -> + let x = Block_id.to_int x.Block.block_id in + let y = Block_id.to_int y.Block.block_id in + if (x>y) then 1 + else if (x