-
Notifications
You must be signed in to change notification settings - Fork 159
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
irmin: add Repo.iter #1128
irmin: add Repo.iter #1128
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Would be good to have tests of the newly-introduced edge cases re. branches and cuts, but that can probably wait for another day.
?edge:(node -> node -> unit Lwt.t) -> | ||
?skip_nodes:(node -> bool Lwt.t) -> | ||
?skip_contents:(contents * metadata -> bool Lwt.t) -> | ||
?skip_node:(node -> bool Lwt.t) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub won't let me suggest it, but need to s/skip_nodes/skip_node/
in comment below.
src/irmin/dot.ml
Outdated
let vertex = Hashtbl.fold (fun k v acc -> (map k, v) :: acc) vertex [] in | ||
let edges = List.map (fun (k, l, v) -> (map k, l, map v)) !edges in | ||
let vertex = Hashtbl.fold (fun k v acc -> (k, v) :: acc) vertex [] in | ||
let edges = List.map (fun (k, l, v) -> (k, l, v)) !edges in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we can remove this map
altogether?
It allows to iterate efficiently over the object graph.
It allows to iterate efficiently over the object graph.
Extracted from #1124