From 0a4c5d6b6e4151f30b1435cd7b452bd832ae6f76 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 26 Aug 2024 15:45:38 +0200 Subject: [PATCH] improve performance of commit-graph variant ever-so-slightly --- gix-revision/src/merge_base.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gix-revision/src/merge_base.rs b/gix-revision/src/merge_base.rs index 40f06f231e1..557423f9ac6 100644 --- a/gix-revision/src/merge_base.rs +++ b/gix-revision/src/merge_base.rs @@ -217,11 +217,10 @@ pub(crate) mod function { type Error = gix_object::decode::Error; fn try_from(commit: LazyCommit<'_, '_>) -> Result { + let (generation, timestamp) = commit.generation_and_timestamp()?; Ok(GenThenTime { - generation: commit - .generation() - .unwrap_or(gix_commitgraph::GENERATION_NUMBER_INFINITY), - time: commit.committer_timestamp()?, + generation: generation.unwrap_or(gix_commitgraph::GENERATION_NUMBER_INFINITY), + time: timestamp, }) } }