Skip to content

Commit

Permalink
evolog: use predecessor_ids() where commit object isn't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Sep 7, 2024
1 parent 25819dd commit c3ed3e3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cli/src/commands/evolog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ pub(crate) fn cmd_evolog(
if !args.no_graph {
let mut graph = get_graphlog(graph_style, formatter.raw());
for commit in commits {
let mut edges = vec![];
for predecessor in commit.predecessors() {
edges.push(Edge::Direct(predecessor?.id().clone()));
}
let edges = commit
.predecessor_ids()
.iter()
.map(|id| Edge::Direct(id.clone()))
.collect_vec();
let graph_width = || graph.width(commit.id(), &edges);
let mut buffer = vec![];
with_content_format.write_graph_text(
Expand Down

0 comments on commit c3ed3e3

Please sign in to comment.