Skip to content

Commit 0a4c5d6

Browse files
committed
improve performance of commit-graph variant ever-so-slightly
1 parent ded2e53 commit 0a4c5d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

gix-revision/src/merge_base.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,10 @@ pub(crate) mod function {
217217
type Error = gix_object::decode::Error;
218218

219219
fn try_from(commit: LazyCommit<'_, '_>) -> Result<Self, Self::Error> {
220+
let (generation, timestamp) = commit.generation_and_timestamp()?;
220221
Ok(GenThenTime {
221-
generation: commit
222-
.generation()
223-
.unwrap_or(gix_commitgraph::GENERATION_NUMBER_INFINITY),
224-
time: commit.committer_timestamp()?,
222+
generation: generation.unwrap_or(gix_commitgraph::GENERATION_NUMBER_INFINITY),
223+
time: timestamp,
225224
})
226225
}
227226
}

0 commit comments

Comments
 (0)