Order blocks by block_id

This commit is contained in:
Anthony Scemama 2020-06-02 00:19:45 +02:00
parent 89bd9d9c7f
commit 4ad08c8c03
1 changed files with 6 additions and 0 deletions

View File

@ -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<y) then -1
else 0)
in
let data_in_range rmin rmax =