Skip to content

Commit

Permalink
perf(changelog): optimize the release vector size
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Aug 14, 2021
1 parent 29db41a commit 7e84797
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub fn run(mut args: Opt) -> Result<()> {
}

// Process releases.
let mut releases = vec![Release::default(); tags.len() + 1];
let mut releases = vec![Release::default()];
let mut release_index = 0;
let mut previous_release = Release::default();
for git_commit in commits.into_iter().rev() {
Expand All @@ -128,6 +128,7 @@ pub fn run(mut args: Opt) -> Result<()> {
previous_release.previous = None;
releases[release_index].previous = Some(Box::new(previous_release));
previous_release = releases[release_index].clone();
releases.push(Release::default());
release_index += 1;
}
}
Expand Down

0 comments on commit 7e84797

Please sign in to comment.