Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: Adapt the code to https://github.com/geneweb/geneweb/pull/1958 #56

Draft
wants to merge 1 commit into
base: gnt
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ let print_last_visited_persons conf base =
let print_max_ancestors =
fun conf base ->
let ipers = Gwdb.ipers base in
let ancestors = Gwdb.iper_marker (Gwdb.ipers base) Geneweb.Util.IperSet.empty in
let ancestors = Gwdb.iper_marker (Gwdb.ipers base) Gwdb.IperSet.empty in
let mark = Gwdb.iper_marker (Gwdb.ipers base) false in
let has_children p =
Array.exists
Expand All @@ -357,18 +357,18 @@ let print_max_ancestors =
| Some ifam ->
let cpl = Gwdb.foi base ifam in
let anc =
Geneweb.Util.IperSet.add (Gwdb.get_father cpl) @@ Gwdb.Marker.get ancestors ip
Gwdb.IperSet.add (Gwdb.get_father cpl) @@ Gwdb.Marker.get ancestors ip
in
let anc =
Geneweb.Util.IperSet.add (Gwdb.get_mother cpl) anc
Gwdb.IperSet.add (Gwdb.get_mother cpl) anc
in
let anc2 =
Geneweb.Util.IperSet.union
Gwdb.IperSet.union
(nb_ancestors (Gwdb.get_father cpl))
(nb_ancestors (Gwdb.get_mother cpl))
in
Geneweb.Util.IperSet.union anc anc2
| None -> Geneweb.Util.IperSet.empty
Gwdb.IperSet.union anc anc2
| None -> Gwdb.IperSet.empty
in
Gwdb.Marker.set ancestors ip anc;
Gwdb.Marker.set mark ip true;
Expand All @@ -390,7 +390,7 @@ let print_max_ancestors =
(* ip, nb_anc *)
let res = ref (Gwdb.dummy_iper, 0) in
Gwdb.Collection.iter begin fun i ->
let nb = Geneweb.Util.IperSet.cardinal @@ Gwdb.Marker.get ancestors i in
let nb = Gwdb.IperSet.cardinal @@ Gwdb.Marker.get ancestors i in
if nb > snd !res then res := (i, nb)
end ipers ;
let ref_p = Api_util.person_to_reference_person base @@ Gwdb.poi base (fst !res) in
Expand Down