Skip to content

Commit 99db66f

Browse files
committed
[Stdlib] Hashtbl: add a getter for randomize
1 parent 85e1732 commit 99db66f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

stdlib/hashtbl.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ let randomized_default =
4747
let randomized = ref randomized_default
4848

4949
let randomize () = randomized := true
50+
let is_randomize () = !randomized
5051

5152
let prng = lazy (Random.State.make_self_init())
5253

stdlib/hashtbl.mli

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ val randomize : unit -> unit
165165
166166
@since 4.00.0 *)
167167

168+
val is_randomize : unit -> bool
169+
(** return if the tables are currently created in randomized mode by default
170+
171+
@since 4.02.0 *)
172+
168173
type statistics = {
169174
num_bindings: int;
170175
(** Number of bindings present in the table.

0 commit comments

Comments
 (0)