Skip to content

Commit

Permalink
Merge pull request #5194 from xcp-ng/fix-rand-err
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont authored Oct 10, 2023
2 parents a0dc809 + 84fad4e commit bfa7c93
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ocaml/quicktest/qt_filter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,11 @@ module SR = struct

let random srs () =
let srs = srs () in
let index = Random.int @@ List.length srs in
[List.nth srs index]
if srs = [] then
[]
else
let index = Random.int @@ List.length srs in
[List.nth srs index]

let sr_filter f srs () = List.filter f (srs ())

Expand Down

0 comments on commit bfa7c93

Please sign in to comment.