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
|
| None -> mk_v_table graph in
|
||||||
(* map from vertices to integers *)
|
(* map from vertices to integers *)
|
||||||
let get_id =
|
let get_id =
|
||||||
let count_map = mk_v_table graph
|
let count = ref 0 in
|
||||||
and count = ref 0 in
|
|
||||||
fun vertex ->
|
fun vertex ->
|
||||||
try PHashtbl.find count_map vertex
|
try PHashtbl.find vertices vertex
|
||||||
with Not_found ->
|
with Not_found ->
|
||||||
let n = !count in
|
let n = !count in
|
||||||
incr count;
|
incr count;
|
||||||
PHashtbl.replace count_map vertex n;
|
PHashtbl.replace vertices vertex n;
|
||||||
n
|
n
|
||||||
(* print an attribute *)
|
(* print an attribute *)
|
||||||
and print_attribute formatter attr =
|
and print_attribute formatter attr =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue