Mariska
Mariska

Reputation: 1949

(OCaml) How does "remove" function from OCaml's PriorityQueue look like?

Does anyone know how does the "remove" function from OCaml's PriorityQueue library look like?

I know how it works but I just wanna see the code.

Thanks!

Upvotes: 2

Views: 342

Answers (1)

Rörd
Rörd

Reputation: 6681

I suppose you're talking about the PriorityQueue module from Holger Arnold's ocaml-base library? Just look at the source, it's this:

let remove h x = 
  try remove_index h (Hashtbl.find h.indices x)
  with Not_found -> ()

Upvotes: 1

Related Questions