mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
fix in Graph.pp
This commit is contained in:
parent
9ce511156e
commit
8da095f76b
1 changed files with 3 additions and 4 deletions
7
graph.ml
7
graph.ml
|
|
@ -318,14 +318,13 @@ let pp ~name ?vertices
|
|||
| None -> mk_v_table graph in
|
||||
(* map from vertices to integers *)
|
||||
let get_id =
|
||||
let count_map = mk_v_table graph
|
||||
and count = ref 0 in
|
||||
let count = ref 0 in
|
||||
fun vertex ->
|
||||
try PHashtbl.find count_map vertex
|
||||
try PHashtbl.find vertices vertex
|
||||
with Not_found ->
|
||||
let n = !count in
|
||||
incr count;
|
||||
PHashtbl.replace count_map vertex n;
|
||||
PHashtbl.replace vertices vertex n;
|
||||
n
|
||||
(* print an attribute *)
|
||||
and print_attribute formatter attr =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue